X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffollow.php;h=cac713b12f93def8d69703b58305e54cf23ce721;hb=aeb6e53d02fdbc3208851a9a4dc8323db29c62c5;hp=711579ff5a013c0fb543db99bdc9d3b0a4603d0e;hpb=de5a0dadb0715198b9ba376e4ab79f58cedef098;p=friendica.git diff --git a/include/follow.php b/include/follow.php index 711579ff5a..cac713b12f 100644 --- a/include/follow.php +++ b/include/follow.php @@ -1,6 +1,7 @@ path)) { - $myaddr = bin2hex(App::get_baseurl() . '/profile/' . $a->user['nickname']); + $myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']); } else { $myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname()); } @@ -186,14 +187,10 @@ function new_contact($uid,$url,$interactive = false) { if (dbm::is_result($r)) { // update contact - if ($r[0]['rel'] == CONTACT_IS_FOLLOWER || ($network === NETWORK_DIASPORA && $r[0]['rel'] == CONTACT_IS_SHARING)) { - q("UPDATE `contact` SET `rel` = %d , `subhub` = %d, `readonly` = 0 WHERE `id` = %d AND `uid` = %d", - intval(CONTACT_IS_FRIEND), - intval($subhub), - intval($r[0]['id']), - intval($uid) - ); - } + $new_relation = (($r[0]['rel'] == CONTACT_IS_FOLLOWER) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); + + $fields = array('rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false); + dba::update('contact', $fields, array('id' => $r[0]['id'])); } else { // check service class limits @@ -221,7 +218,7 @@ function new_contact($uid,$url,$interactive = false) { return $result; } - $new_relation = ((in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA))) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); + $new_relation = ((in_array($ret['network'], array(NETWORK_MAIL))) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); // create contact record $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `batch`, `notify`, `poll`, `poco`, `name`, `nick`, `network`, `pubkey`, `rel`, `priority`,