X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffollow.php;h=b4d1732b88091e5e7b21af3d5c71294d12955b89;hb=5016a589fbc6975d0808a0c298d1f92773af8d19;hp=22288a0daf64b1d01ed134de487f494852012187;hpb=da7773a259bfd40b1c2346fb7c3900f2b67e8fec;p=friendica.git diff --git a/include/follow.php b/include/follow.php index 22288a0daf..b4d1732b88 100644 --- a/include/follow.php +++ b/include/follow.php @@ -62,6 +62,11 @@ function new_contact($uid,$url,$interactive = false) { } } + + + + + // This extra param just confuses things, remove it if($ret['network'] === NETWORK_DIASPORA) $ret['url'] = str_replace('?absolute=true','',$ret['url']); @@ -89,6 +94,11 @@ function new_contact($uid,$url,$interactive = false) { $ret['notify'] = ''; } + + + + + if(! $ret['notify']) { $result['message'] .= t('Limited profile. This person will be unable to receive direct/personal notifications from you.') . EOL; } @@ -129,6 +139,32 @@ function new_contact($uid,$url,$interactive = false) { } else { + + // check service class limits + + $r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0", + intval($uid) + ); + if(count($r)) + $total_contacts = $r[0]['total']; + + if(! service_class_allows($uid,'total_contacts',$total_contacts)) { + $result['message'] .= upgrade_message(); + return $result; + } + + $r = q("select count(network) as total from contact where uid = %d and network = '%s' and pending = 0 and self = 0", + intval($uid), + dbesc($network) + ); + if(count($r)) + $total_network = $r[0]['total']; + + if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) { + $result['message'] .= upgrade_message(); + return $result; + } + $new_relation = (($ret['network'] === NETWORK_MAIL) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); if($ret['network'] === NETWORK_DIASPORA) $new_relation = CONTACT_IS_FOLLOWER;