]> git.mxchange.org Git - friendica.git/commitdiff
Don't show following/followed_by on pending
authorMichael <heluecht@pirati.ca>
Sun, 6 Nov 2022 08:18:28 +0000 (08:18 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 6 Nov 2022 08:18:28 +0000 (08:18 +0000)
src/Object/Api/Mastodon/Relationship.php

index 96e1201a3d432310ee85e9308de3aa4168917459..6cfb4b99480a03c75472e2e9e8ecd5d0884df33a 100644 (file)
@@ -94,9 +94,9 @@ class Relationship extends BaseDataTransferObject
                $this->note                 = '';
 
                if ($contactRecord['uid'] != 0) {
-                       $this->following   = in_array($contactRecord['rel'] ?? 0, [Contact::SHARING, Contact::FRIEND]);
+                       $this->following   = !$contactRecord['pending'] && in_array($contactRecord['rel'] ?? 0, [Contact::SHARING, Contact::FRIEND]);
                        $this->requested   = (bool)($contactRecord['pending'] ?? false);
-                       $this->followed_by = in_array($contactRecord['rel'] ?? 0, [Contact::FOLLOWER, Contact::FRIEND]);
+                       $this->followed_by = !$contactRecord['pending'] && in_array($contactRecord['rel'] ?? 0, [Contact::FOLLOWER, Contact::FRIEND]);
                        $this->muting      = (bool)($contactRecord['readonly'] ?? false) || $muted;
                        $this->notifying   = (bool)$contactRecord['notify_new_posts'] ?? false;
                        $this->blocking    = (bool)($contactRecord['blocked'] ?? false) || $blocked;