aboutsummaryrefslogtreecommitdiffstats
path: root/include/follow.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-07-06 22:47:27 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-07-06 22:47:27 +0530
commitba4db236ecff1ffdb56adc2715b3f53515f8cb34 (patch)
treef0b9928aade8aab95d1608890fde1918ce163754 /include/follow.php
parent6e4760dd9c512147309b5e4a98d25216610f81da (diff)
parenta122fecf50d06856a2ada8b564f711fb52c327f0 (diff)
downloadvolse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.tar.gz
volse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.tar.bz2
volse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'include/follow.php')
-rw-r--r--include/follow.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/follow.php b/include/follow.php
index 22288a0da..b4d1732b8 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;