From e10d714ef5850be3b4c37c047734d99ad99a039f Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 6 Nov 2022 08:18:28 +0000 Subject: [PATCH] Don't show following/followed_by on pending --- src/Object/Api/Mastodon/Relationship.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Object/Api/Mastodon/Relationship.php b/src/Object/Api/Mastodon/Relationship.php index 96e1201a3..6cfb4b994 100644 --- a/src/Object/Api/Mastodon/Relationship.php +++ b/src/Object/Api/Mastodon/Relationship.php @@ -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;