X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffollow.php;h=14b9c68ed59fd3476154a2ec367ab84d63adde71;hb=755f6e8cc1ceb5fab0c0f63deb3ca7048d1ea48d;hp=c5214fe4612ae22bb24e16338e8726af035c5aa2;hpb=541d6ab8959fe3c069996e230def126c154da34d;p=friendica.git diff --git a/include/follow.php b/include/follow.php index c5214fe461..14b9c68ed5 100644 --- a/include/follow.php +++ b/include/follow.php @@ -1,20 +1,24 @@ $new_relation, 'subhub' => $subhub, 'readonly' => false); dba::update('contact', $fields, array('id' => $r[0]['id'])); } 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 (dbm::is_result($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 (dbm::is_result($r)) { - $total_network = $r[0]['total']; - } - - if (! service_class_allows($uid,'total_contacts_' . $network,$total_network)) { - $result['message'] .= upgrade_message(); - return $result; - } - $new_relation = ((in_array($ret['network'], array(NETWORK_MAIL))) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING); // create contact record @@ -257,7 +235,7 @@ function new_contact($uid, $url, $interactive = false, $network = '') { intval($uid) ); - if (! dbm::is_result($r)) { + if (! DBM::is_result($r)) { $result['message'] .= t('Unable to retrieve contact information.') . EOL; return $result; } @@ -272,29 +250,29 @@ function new_contact($uid, $url, $interactive = false, $network = '') { } // Update the avatar - update_contact_avatar($ret['photo'],$uid,$contact_id); + Contact::updateAvatar($ret['photo'], $uid, $contact_id); // pull feed and consume it, which should subscribe to the hub. - proc_run(PRIORITY_HIGH, "include/onepoll.php", $contact_id, "force"); + Worker::add(PRIORITY_HIGH, "OnePoll", $contact_id, "force"); $r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1", intval($uid) ); - if (dbm::is_result($r)) { + if (DBM::is_result($r)) { if (($contact['network'] == NETWORK_OSTATUS) && (strlen($contact['notify']))) { // create a follow slap $item = array(); $item['verb'] = ACTIVITY_FOLLOW; $item['follow'] = $contact["url"]; - $slap = ostatus::salmon($item, $r[0]); - slapper($r[0], $contact['notify'], $slap); + $slap = OStatus::salmon($item, $r[0]); + Salmon::slapper($r[0], $contact['notify'], $slap); } if ($contact['network'] == NETWORK_DIASPORA) { - $ret = Diaspora::send_share($a->user,$contact); + $ret = Diaspora::sendShare($a->user, $contact); logger('share returns: '.$ret); } }