diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 0ebdcec004..8267674e52 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -1123,6 +1123,17 @@ class Profile $_SESSION['visitor_home'] = $visitor['url']; $_SESSION['my_url'] = $visitor['url']; + /// @todo replace this and the query for this variable with some cleaner functionality + $_SESSION['remote'] = []; + + $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => $visitor['nurl'], 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]); + while ($contact = DBA::fetch($remote_contacts)) { + if (($contact['uid'] == 0) || Contact::isBlockedByUser($visitor['id'], $contact['uid'])) { + continue; + } + + $_SESSION['remote'][] = ['cid' => $contact['id'], 'uid' => $contact['uid'], 'url' => $visitor['url']]; + } $arr = [ 'visitor' => $visitor, 'url' => $a->query_string