]> git.mxchange.org Git - friendica.git/commitdiff
ActivityPub: Update relation when receiving a follow reject message
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 15:19:41 +0000 (11:19 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 2 Oct 2021 17:52:54 +0000 (13:52 -0400)
src/Protocol/ActivityPub/Processor.php

index 41af3db3fabcbdf64320ba55349957ddc839a1e4..ec2810277b4816dcf5e88333faea06141d66daa5 100644 (file)
@@ -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]);
                }