Breakup public/user ID query results so can always query blocked status by CID

This commit is contained in:
Hank Grabowski 2023-02-22 12:07:57 -05:00
parent b3226e11ac
commit 4a00731aa4

View file

@ -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)
);
}
}