- if (count($contact) > 0) {
- $unknown_contacts[] = [
- 'type' => 'c',
- 'photo' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO),
- 'name' => htmlentities($contact['name']),
- 'id' => intval($contact['cid']),
- 'network' => $contact['network'],
- 'link' => $contact['url'],
- 'nick' => htmlentities(defaults($contact, 'nick', $contact['addr'])),
- 'addr' => htmlentities(defaults($contact, 'addr', $contact['url'])),
- 'forum' => $contact['forum']
- ];
- }
+ $condition = ["`parent` = ?", $conv_id];
+ $params = ['order' => ['author-name' => true]];
+ $authors = Item::selectForUser(local_user(), ['author-link'], $condition, $params);
+ $item_authors = [];
+ while ($author = Item::fetch($authors)) {
+ $item_authors[$author['author-link']] = $author['author-link'];
+ }
+ DBA::close($authors);
+
+ foreach ($item_authors as $author) {
+ if (in_array($author, $known_contacts)) {
+ continue;
+ }
+
+ $contact = Contact::getDetailsByURL($author);
+
+ if (count($contact) > 0) {
+ $unknown_contacts[] = [
+ 'type' => 'c',
+ 'photo' => ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO),
+ 'name' => htmlspecialchars($contact['name']),
+ 'id' => intval($contact['cid']),
+ 'network' => $contact['network'],
+ 'link' => $contact['url'],
+ 'nick' => htmlentities(defaults($contact, 'nick', $contact['addr'])),
+ 'addr' => htmlentities(defaults($contact, 'addr', $contact['url'])),
+ 'forum' => $contact['forum']
+ ];