X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffollow.php;h=21c05c8f3ef139062963dfbd05446b96f492d9a4;hb=20befee9eda5238fbd4691df8ccf88e7d497a2cf;hp=ca0228cc0f89542f3f66ae7531de0fe3c68e6329;hpb=32e8f3468d17f9f84b308aa903f7efa1fa22441f;p=friendica.git diff --git a/include/follow.php b/include/follow.php index ca0228cc0f..21c05c8f3e 100644 --- a/include/follow.php +++ b/include/follow.php @@ -154,11 +154,7 @@ function new_contact($uid,$url,$interactive = false) { $hidden = (($ret['network'] === NETWORK_MAIL) ? 1 : 0); - if($ret['network'] === NETWORK_MAIL) { - $writeable = 1; - - } - if($ret['network'] === NETWORK_DIASPORA) + if(in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA))) $writeable = 1; // check if we already have a contact @@ -215,9 +211,7 @@ function new_contact($uid,$url,$interactive = false) { return $result; } - $new_relation = (($ret['network'] === NETWORK_MAIL) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); - if($ret['network'] === NETWORK_DIASPORA) - $new_relation = CONTACT_IS_FOLLOWER; + $new_relation = ((in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA))) ? 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`,