diff --git a/include/follow.php b/include/follow.php index 287a38b6bf..6c998e1781 100644 --- a/include/follow.php +++ b/include/follow.php @@ -1,5 +1,48 @@ $val) { + if (isset($r[0][$key]) AND ($r[0][$key] != "") AND ($val == "")) + $ret[$key] = $r[0][$key]; + + if (isset($r[0][$key]) AND ($ret[$key] != $r[0][$key])) + $update = true; + } + + if (!$update) + return; + + q("UPDATE `contact` SET `url` = '%s', `nurl` = '%s', `addr` = '%s', `alias` = '%s', `batch` = '%s', `notify` = '%s', `poll` = '%s', `poco` = '%s' WHERE `id` = %d", + dbesc($ret['url']), + dbesc(normalise_link($ret['url'])), + dbesc($ret['addr']), + dbesc($ret['alias']), + dbesc($ret['batch']), + dbesc($ret['notify']), + dbesc($ret['poll']), + dbesc($ret['poco']), + intval($id) + ); +} // // Takes a $uid and a url/handle and adds a new contact @@ -120,9 +163,10 @@ function new_contact($uid,$url,$interactive = false) { // the poll url is more reliable than the profile url, as we may have // indirect links or webfinger links - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `poll` = '%s' AND `network` = '%s' LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `poll` IN ('%s', '%s') AND `network` = '%s' LIMIT 1", intval($uid), dbesc($ret['poll']), + dbesc(normalise_link($ret['poll'])), dbesc($ret['network']) ); @@ -136,8 +180,8 @@ function new_contact($uid,$url,$interactive = false) { intval($uid) ); } - } - else { + + } else { // check service class limits diff --git a/include/onepoll.php b/include/onepoll.php index 7b93a9a2f0..d1f41d65f5 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -1,6 +1,7 @@ $this->get_template(),