if (is_array($noscrapedata)) {
if ($noscrapedata["nick"] != "")
return($noscrapedata);
+ else
+ unset($noscrapedata["nick"]);
} else
$noscrapedata = array();
}
$s = fetch_url($url);
- if(! $s)
+ if (!$s)
return $ret;
if (!$dont_probe) {
if (($vcard["nick"] == "") AND ($data["header"]["author-nick"] != ""))
$vcard["nick"] = $data["header"]["author-nick"];
+ if (($network == NETWORK_OSTATUS) AND ($data["header"]["author-id"] != ""))
+ $alias = $data["header"]["author-id"];
+
if(!$profile AND ($data["header"]["author-link"] != "") AND !in_array($network, array("", NETWORK_FEED)))
$profile = $data["header"]["author-link"];
}
/// The biggest problem is the avatar picture that could have a reduced image size.
/// It should only be updated if the existing picture isn't existing anymore.
if (($result['network'] != NETWORK_FEED) AND ($mode == PROBE_NORMAL) AND
- $result["addr"] AND $result["name"] AND $result["nick"])
- q("UPDATE `contact` SET `addr` = '%s', `alias` = '%s', `name` = '%s', `nick` = '%s',
- `success_update` = '%s' WHERE `nurl` = '%s' AND NOT `self` AND `uid` = 0",
- dbesc($result["addr"]),
- dbesc($result["alias"]),
+ $result["name"] AND $result["nick"] AND $result["url"] AND $result["addr"] AND $result["poll"])
+ q("UPDATE `contact` SET `name` = '%s', `nick` = '%s', `url` = '%s', `addr` = '%s',
+ `notify` = '%s', `poll` = '%s', `alias` = '%s', `success_update` = '%s'
+ WHERE `nurl` = '%s' AND NOT `self` AND `uid` = 0",
dbesc($result["name"]),
dbesc($result["nick"]),
+ dbesc($result["url"]),
+ dbesc($result["addr"]),
+ dbesc($result["notify"]),
+ dbesc($result["poll"]),
+ dbesc($result["alias"]),
dbesc(datetime_convert()),
dbesc(normalise_link($result['url']))
);
// This call is very "cheap" so we can do it at any time without a problem
q("UPDATE `item` INNER JOIN `item` AS `parent` ON `parent`.`uri` = `item`.`parent-uri` AND `parent`.`uid` = `item`.`uid` SET `item`.`parent` = `parent`.`id` WHERE `item`.`parent` = 0");
+ // There was an issue where the nick vanishes from the contact table
+ q("UPDATE `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid` SET `nick` = `nickname` WHERE `self` AND `nick`=''");
+
/// @todo
/// - remove thread entries without item
/// - remove sign entries without item
if ($attributes->name == "href")
$author["author-link"] = $attributes->textContent;
+ $author["author-id"] = $xpath->evaluate('/atom:feed/atom:author/atom:uri/text()')->item(0)->nodeValue;
+
if ($author["author-link"] == "")
- $author["author-link"] = $xpath->evaluate('/atom:feed/atom:author/atom:uri/text()')->item(0)->nodeValue;
+ $author["author-link"] = $author["author-id"];
if ($author["author-link"] == "") {
$self = $xpath->query("atom:link[@rel='self']")->item(0)->attributes;
// This is no field in the item table. So we have to unset it.
unset($author["author-nick"]);
+ unset($author["author-id"]);
}
$header = array();
$json_info = array(
'fn' => $a->profile['name'],
'addr' => $a->profile['addr'],
- 'nick' => $a->user['nickname'],
+ 'nick' => $which,
'key' => $a->profile['pubkey'],
'homepage' => $a->get_baseurl()."/profile/{$which}",
'comm' => (x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),