From: Hypolite Petovan Date: Sat, 2 Oct 2021 15:19:41 +0000 (-0400) Subject: ActivityPub: Update relation when receiving a follow reject message X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e6aef548fb512f3d23fef8f2c903d3f036c65671;p=friendica.git ActivityPub: Update relation when receiving a follow reject message --- diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index 41af3db3fa..ec2810277b 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1037,9 +1037,12 @@ class Processor self::switchContact($cid); - if (DBA::exists('contact', ['id' => $cid, 'rel' => Contact::SHARING])) { + $contact = Contact::getById($cid, ['rel']); + if ($contact['rel'] == Contact::SHARING) { Contact::remove($cid); Logger::info('Rejected contact request - contact removed', ['contact' => $cid, 'user' => $uid]); + } elseif ($contact['rel'] == Contact::FRIEND) { + Contact::update(['rel' => Contact::FOLLOWER], ['id' => $cid]); } else { Logger::info('Rejected contact request', ['contact' => $cid, 'user' => $uid]); }