}
function _contact_update_profile($contact_id) {
- $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($contact_id));
+ $r = q("SELECT `url`, `network` FROM `contact` WHERE `id` = %d", intval($contact_id));
if (!$r)
return;
$data = probe_url($r[0]["url"]);
+ // "Feed" is mostly a sign of communication problems
+ if (($data["network"] == NETWORK_FEED) AND ($data["network"] != $r[0]["network"]))
+ return;
+
$updatefields = array("name", "nick", "url", "addr", "batch", "notify", "poll", "request", "confirm",
"poco", "network", "alias", "pubkey");
$update = array();
if (isset($data[$field]) AND ($data[$field] != ""))
$update[$field] = $data[$field];
+ $update["nurl"] = normalise_link($data["url"]);
+
$query = "";
if (isset($data["priority"]) AND ($data["priority"] != 0))
if($cmd === 'updateprofile') {
_contact_update_profile($contact_id);
- goaway($a->get_baseurl(true) . '/contacts/' . $contact_id);
+ goaway($a->get_baseurl(true) . '/crepair/' . $contact_id);
// NOTREACHED
}
$tpl = get_markup_template('crepair.tpl');
$o .= replace_macros($tpl, array(
'$update_profile' => update_profile,
- '$udprofilenow' => t('Update profile now'),
+ '$udprofilenow' => t('Refetch contact data'),
'$label_name' => t('Name'),
'$label_nick' => t('Account Nickname'),
'$label_attag' => t('@Tagname - overrides Name/Nickname'),