[PLUGIN][ActivityPub] Fix incorrect use of `ActivityPubActor::create`, should be `::createOrUpdate`

This commit is contained in:
tsmethurst 2022-10-20 14:23:13 +02:00 committed by Hugo Sales
parent dc240fae49
commit 3b3ded5212
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
1 changed files with 3 additions and 3 deletions

View File

@ -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);