X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FProcessor.php;h=9eb1506a2878deba0a71064205f189732960087d;hb=fa1f48e1711c64d42ddb0f72c7670fa28f56482d;hp=a5f6607edcadda62f1d77fd5c7fb797e8955839e;hpb=ecf4789cc441571bb5007983f8b0bcd08724a074;p=friendica.git diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index a5f6607edc..9eb1506a28 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -567,7 +567,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']), @@ -578,7 +578,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;