[PLUGIN][ActivityPub] Fix incorrect use of ActivityPubActor::create
, should be ::createOrUpdate
This commit is contained in:
parent
dc240fae49
commit
3b3ded5212
@ -118,7 +118,7 @@ class Actor extends Model
|
||||
'modified' => new DateTime(),
|
||||
];
|
||||
if (isset($options['objects']['Actor'])) {
|
||||
$actor = GSActor::create($actor_map, $options['objects']['Actor']);
|
||||
$actor = GSActor::createOrUpdate($options['objects']['Actor'], $actor_map);
|
||||
} else {
|
||||
$actor = GSActor::create($actor_map);
|
||||
DB::persist($actor);
|
||||
@ -133,7 +133,7 @@ class Actor extends Model
|
||||
'url' => $object->get('url') ?? null,
|
||||
];
|
||||
if (isset($options['objects']['ActivitypubActor'])) {
|
||||
$ap_actor = ActivitypubActor::create($ap_actor_map, $options['objects']['ActivitypubActor']);
|
||||
$ap_actor = ActivitypubActor::createOrUpdate($options['objects']['ActivitypubActor'], $ap_actor_map);
|
||||
} else {
|
||||
$ap_actor = ActivitypubActor::create($ap_actor_map);
|
||||
DB::persist($ap_actor);
|
||||
@ -145,7 +145,7 @@ class Actor extends Model
|
||||
'public_key' => ($object->has('publicKey') && isset($object->get('publicKey')['publicKeyPem'])) ? $object->get('publicKey')['publicKeyPem'] : null,
|
||||
];
|
||||
if (isset($options['objects']['ActivitypubRsa'])) {
|
||||
$apRSA = ActivitypubRsa::create($ap_rsa_map, $options['objects']['ActivitypubRsa']);
|
||||
$apRSA = ActivitypubRsa::createOrUpdate($options['objects']['ActivitypubRsa'], $ap_rsa_map);
|
||||
} else {
|
||||
$apRSA = ActivitypubRsa::create($ap_rsa_map);
|
||||
DB::persist($apRSA);
|
||||
|
Loading…
Reference in New Issue
Block a user