X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FProcessor.php;h=fd84f494e2d597f172269b64e5790d1a5e4c420a;hb=57f6086fcd42e97069ebdf2c81bd481db4f3e2c4;hp=045c48a4c1ced304920444f465f559bd6973d65a;hpb=fc312e4c98ea51c19f190c72bbb73e70ef8b5ad7;p=friendica.git diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 045c48a4c1..fd84f494e2 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -530,7 +530,7 @@ class Processor DBA::update('contact', ['hub-verify' => $activity['id'], 'protocol' => Protocol::ACTIVITYPUB], ['id' => $cid]); $contact = DBA::selectFirst('contact', [], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]); } else { - $contact = false; + $contact = []; } $item = ['author-id' => Contact::getIdForURL($activity['actor']), @@ -541,7 +541,11 @@ class Processor // Ensure that the contact has got the right network type self::switchContact($item['author-id']); - Contact::addRelationship($owner, $contact, $item, '', false, $note); + $result = Contact::addRelationship($owner, $contact, $item, false, $note); + if ($result === true) { + ActivityPub\Transmitter::sendContactAccept($item['author-link'], $item['author-id'], $owner['uid']); + } + $cid = Contact::getIdForURL($activity['actor'], $uid); if (empty($cid)) { return;