diff --git a/mod/contacts.php b/mod/contacts.php index 2e70c9ab8..5d40ff994 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -211,12 +211,16 @@ function _contact_update($contact_id) { } 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(); @@ -225,6 +229,8 @@ function _contact_update_profile($contact_id) { 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)) @@ -344,7 +350,7 @@ function contacts_content(&$a) { 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 } diff --git a/mod/crepair.php b/mod/crepair.php index 670143d35..55231faf7 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -165,7 +165,7 @@ function crepair_content(&$a) { $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'),