<?php
function update_contact($id) {
- $r = q("SELECT `url`, `network` FROM `contact` WHERE `id` = %d", intval($id));
+ /*
+ Warning: Never ever fetch the public key via probe_url and write it into the contacts.
+ This will reliably kill your communication with Friendica contacts.
+ */
+
+ $r = q("SELECT `url`, `nurl`, `addr`, `alias`, `batch`, `notify`, `poll`, `poco`, `name`, `nick`, `network` FROM `contact` WHERE `id` = %d", intval($id));
if (!$r)
return;
if ($ret["network"] != $r[0]["network"])
return;
+ // make sure to not overwrite existing values with blank entries
+ foreach ($ret AS $key => $val)
+ if (isset($r[0][$key]) AND ($r[0][$key] != "") AND ($val == ""))
+ $ret[$key] = $r[0][$key];
+
q("UPDATE `contact` SET `url` = '%s', `nurl` = '%s', `addr` = '%s', `alias` = '%s', `batch` = '%s', `notify` = '%s', `poll` = '%s', `poco` = '%s', `name` = '%s', `nick` = '%s' WHERE `id` = %d",
dbesc($ret['url']),
dbesc(normalise_link($ret['url'])),
$final_dfrn_id = substr($final_dfrn_id,2);
if($final_dfrn_id != $orig_id) {
- logger('dfrn_deliver: wrong dfrn_id. Original: '.$orig_id.' Target: '.$final_dfrn_id.' Test: '.$test);
+ logger('dfrn_deliver: wrong dfrn_id.');
// did not decode properly - cannot trust this site
return 3;
}
if (($item["item_network"] == NETWORK_FACEBOOK) AND ($indent == 'comment') AND isset($buttons["like"]))
unset($buttons["like"]);
+ // Likes don't federate at OStatus
+ if (($item["item_network"] == NETWORK_OSTATUS) AND isset($buttons["like"]))
+ unset($buttons["like"]);
$tmp_item = array(
'template' => $this->get_template(),