// If the contact id doesn't fit with the contact, then set the contact to null
$thrparent = q("SELECT `author-link`, `network` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($thr_parent));
- if (count($thrparent) AND ($thrparent[0]["network"] === NETWORK_OSTATUS)
+ if (dbm::is_result($thrparent) AND ($thrparent[0]["network"] === NETWORK_OSTATUS)
AND (normalise_link($parent_contact["url"]) != normalise_link($thrparent[0]["author-link"]))) {
- $parent_contact = null;
-
- $r = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
- dbesc(normalise_link($thrparent[0]["author-link"])));
- if (dbm::is_result($r)) {
- $parent_contact = $r[0];
- $parent_contact["thumb"] = $parent_contact["photo"];
- $parent_contact["micro"] = $parent_contact["photo"];
- unset($parent_contact["id"]);
- }
+ $parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]);
if (!isset($parent_contact["nick"])) {
require_once("include/Scrape.php");