]> git.mxchange.org Git - friendica.git/commitdiff
Fix warning: Undefined array key "public"
authorMichael <heluecht@pirati.ca>
Wed, 9 Nov 2022 06:31:05 +0000 (06:31 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 9 Nov 2022 06:31:05 +0000 (06:31 +0000)
src/Factory/Api/Mastodon/Relationship.php

index 6d78b50c2197957f8aea75ff6f4ec9d471dd1eaa..9d11f589567550924ce1b0750f20297c186d70a2 100644 (file)
@@ -39,12 +39,13 @@ class Relationship extends BaseFactory
        {
                $cdata = Contact::getPublicAndUserContactID($contactId, $uid);
                if (!empty($cdata)) {
-                       $cid = $cdata['user'];
+                       $cid  = $cdata['user'];
+                       $pcid = $cdata['public'];
                } else {
-                       $cid = $contactId;
+                       $pcid = $cid = $contactId;
                }
 
-               return new RelationshipEntity($cdata['public'], Contact::getById($cid),
+               return new RelationshipEntity($pcid, Contact::getById($cid),
                        Contact\User::isBlocked($cid, $uid), Contact\User::isIgnored($cid, $uid));
        }
 }