]> git.mxchange.org Git - friendica.git/blobdiff - include/follow.php
Merge remote-tracking branch 'upstream/develop' into rewrites/mixed-static-object...
[friendica.git] / include / follow.php
index 77f0bbe2f102f246e8abab9cf68dc311207d8684..7a3514b3a73aa4942ca00f009cc6128361782461 100644 (file)
@@ -177,12 +177,12 @@ function new_contact($uid,$url,$interactive = false) {
                dbesc($ret['network'])
        );
 
-       if(!count($r))
+       if (!dbm::is_result($r))
                $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND `network` = '%s' LIMIT 1",
                        intval($uid), dbesc(normalise_link($url)), dbesc($ret['network'])
        );
 
-       if(count($r)) {
+       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",
@@ -200,7 +200,7 @@ function new_contact($uid,$url,$interactive = false) {
                $r = q("select count(*) as total from contact where uid = %d and pending = 0 and self = 0",
                        intval($uid)
                );
-               if(count($r))
+               if (dbm::is_result($r))
                        $total_contacts = $r[0]['total'];
 
                if(! service_class_allows($uid,'total_contacts',$total_contacts)) {
@@ -212,7 +212,7 @@ function new_contact($uid,$url,$interactive = false) {
                        intval($uid),
                        dbesc($network)
                );
-               if(count($r))
+               if (dbm::is_result($r))
                        $total_network = $r[0]['total'];
 
                if(! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
@@ -254,7 +254,7 @@ function new_contact($uid,$url,$interactive = false) {
                intval($uid)
        );
 
-       if(! count($r)) {
+       if(! dbm::is_result($r)) {
                $result['message'] .=  t('Unable to retrieve contact information.') . EOL;
                return $result;
        }