From: Hank Grabowski Date: Wed, 22 Feb 2023 17:07:57 +0000 (-0500) Subject: Breakup public/user ID query results so can always query blocked status by CID X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4a00731aa4433903a2ee38e9de67f0796f6dfeca;p=friendica.git Breakup public/user ID query results so can always query blocked status by CID --- diff --git a/src/Factory/Api/Mastodon/Relationship.php b/src/Factory/Api/Mastodon/Relationship.php index 3c9dca3024..f1ca4a1f9e 100644 --- a/src/Factory/Api/Mastodon/Relationship.php +++ b/src/Factory/Api/Mastodon/Relationship.php @@ -38,14 +38,14 @@ class Relationship extends BaseFactory public function createFromContactId(int $contactId, int $uid): RelationshipEntity { $cdata = Contact::getPublicAndUserContactID($contactId, $uid); - if (!empty($cdata)) { - $cid = $cdata['user']; - $pcid = $cdata['public']; - } else { - $pcid = $cid = $contactId; - } + $pcid = !empty($cdata['public']) ? $cdata['public'] : $contactId; + $cid = !empty($cdata['user']) ? $cdata['user'] : $contactId; - return new RelationshipEntity($pcid, Contact::getById($cid), - Contact\User::isBlocked($cid, $uid), Contact\User::isIgnored($cid, $uid)); + return new RelationshipEntity( + $pcid, + Contact::getById($cid), + Contact\User::isBlocked($cid, $uid), + Contact\User::isIgnored($cid, $uid) + ); } }