+ /**
+ * Fetch contact url list from the given local user
+ *
+ * @param integer $uid
+ * @param array $rel
+ * @return array contact list
+ */
+ private static function getContacts(int $uid, array $rel): array
+ {
+ $list = [];
+ $profile = Profile::getByUID($uid);
+ if (!empty($profile['hide-friends'])) {
+ return $list;
+ }
+
+ $condition = [
+ 'rel' => $rel,
+ 'uid' => $uid,
+ 'self' => false,
+ 'deleted' => false,
+ 'hidden' => false,
+ 'archive' => false,
+ 'pending' => false,
+ ];
+ $condition = DBA::mergeConditions($condition, ["`url` IN (SELECT `url` FROM `apcontact`)"]);
+ $contacts = DBA::select('contact', ['url'], $condition);
+ while ($contact = DBA::fetch($contacts)) {
+ $list[] = $contact['url'];
+ }
+ DBA::close($contacts);
+
+ return $list;
+ }
+