From 0ddb315b23882f3ba9e709f9a4e499cc237d1e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 23 Jun 2022 16:46:44 +0200 Subject: [PATCH] $id in Transmitter::sendContactAccept() is a string, see Introduction class --- src/Protocol/ActivityPub/Processor.php | 6 ++++-- src/Protocol/ActivityPub/Transmitter.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 0b58427c3..d9dd7ee5b 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1267,8 +1267,10 @@ class Processor Contact::update(['hub-verify' => $activity['id'], 'protocol' => Protocol::ACTIVITYPUB], ['id' => $cid]); } - $item = ['author-id' => Contact::getIdForURL($activity['actor']), - 'author-link' => $activity['actor']]; + $item = [ + 'author-id' => Contact::getIdForURL($activity['actor']), + 'author-link' => $activity['actor'], + ]; // Ensure that the contact has got the right network type self::switchContact($item['author-id']); diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 6384e2ed4..d467f9a54 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -2116,13 +2116,13 @@ class Transmitter * Transmit a message that the contact request had been accepted * * @param string $target Target profile - * @param integer $id Object id + * @param string $id Object id * @param integer $uid User ID * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \ImagickException */ - public static function sendContactAccept(string $target, int $id, int $uid) + public static function sendContactAccept(string $target, string $id, int $uid) { $profile = APContact::getByURL($target); if (empty($profile['inbox'])) { @@ -2137,7 +2137,7 @@ class Transmitter 'type' => 'Accept', 'actor' => $owner['url'], 'object' => [ - 'id' => (string)$id, + 'id' => $id, 'type' => 'Follow', 'actor' => $profile['url'], 'object' => $owner['url']