]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/GContact.php
Added true to json_decode (#5471)
[friendica.git] / src / Model / GContact.php
index 6a6f6cd349cc9ed86d7917e267f7a0bb76f7c8ee..5cf613388cbdfe32dadf5cc033bed1dce439f8dd 100644 (file)
@@ -11,7 +11,6 @@ use Friendica\Core\Config;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
-use Friendica\Database\DBM;
 use Friendica\Network\Probe;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\DateTimeFormat;
@@ -106,7 +105,7 @@ class GContact
                        intval($zcid)
                );
 
-               if (!DBM::is_result($r)) {
+               if (!DBA::isResult($r)) {
                        q(
                                "INSERT INTO `glink` (`cid`, `uid`, `gcid`, `zcid`, `updated`) VALUES (%d, %d, %d, %d, '%s') ",
                                intval($cid),
@@ -180,7 +179,7 @@ class GContact
                                dbesc(normalise_link($gcontact['url'])),
                                dbesc(NETWORK_STATUSNET)
                        );
-                       if (DBM::is_result($r)) {
+                       if (DBA::isResult($r)) {
                                $gcontact['network'] = $r[0]["network"];
                        }
 
@@ -191,7 +190,7 @@ class GContact
                                        dbesc(normalise_link($gcontact['url'])),
                                        dbesc(NETWORK_STATUSNET)
                                );
-                               if (DBM::is_result($r)) {
+                               if (DBA::isResult($r)) {
                                        $gcontact['network'] = $r[0]["network"];
                                }
                        }
@@ -205,7 +204,7 @@ class GContact
                        dbesc(normalise_link($gcontact['url']))
                );
 
-               if (DBM::is_result($x)) {
+               if (DBA::isResult($x)) {
                        if (!isset($gcontact['network']) && ($x[0]["network"] != NETWORK_STATUSNET)) {
                                $gcontact['network'] = $x[0]["network"];
                        }
@@ -290,7 +289,7 @@ class GContact
                );
 
                // logger("countCommonFriends: $uid $cid {$r[0]['total']}");
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        return $r[0]['total'];
                }
                return 0;
@@ -312,7 +311,7 @@ class GContact
                        intval($uid)
                );
 
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        return $r[0]['total'];
                }
 
@@ -353,7 +352,7 @@ class GContact
                        intval($limit)
                );
 
-               /// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
+               /// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
                return $r;
        }
 
@@ -385,7 +384,7 @@ class GContact
                        intval($limit)
                );
 
-               /// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
+               /// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
                return $r;
        }
 
@@ -405,7 +404,7 @@ class GContact
                        intval($uid)
                );
 
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        return $r[0]['total'];
                }
 
@@ -436,7 +435,7 @@ class GContact
                        intval($limit)
                );
 
-               /// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
+               /// @TODO Check all calling-findings of this function if they properly use DBA::isResult()
                return $r;
        }
 
@@ -496,7 +495,7 @@ class GContact
                        intval($limit)
                );
 
-               if (DBM::is_result($r) && count($r) >= ($limit -1)) {
+               if (DBA::isResult($r) && count($r) >= ($limit -1)) {
                        /*
                        * Uncommented because the result of the queries are to big to store it in the cache.
                        * We need to decide if we want to change the db column type or if we want to delete it.
@@ -585,7 +584,7 @@ class GContact
                        dbesc(NETWORK_DIASPORA)
                );
 
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        foreach ($r as $rr) {
                                $base = substr($rr['poco'], 0, strrpos($rr['poco'], '/'));
                                if (! in_array($base, $done)) {
@@ -694,7 +693,7 @@ class GContact
                        dbesc(normalise_link($contact["url"]))
                );
 
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        $gcontact_id = $r[0]["id"];
 
                        // Update every 90 days
@@ -729,7 +728,7 @@ class GContact
                                dbesc(normalise_link($contact["url"]))
                        );
 
-                       if (DBM::is_result($r)) {
+                       if (DBA::isResult($r)) {
                                $gcontact_id = $r[0]["id"];
 
                                $doprobing = in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""]);
@@ -878,7 +877,7 @@ class GContact
                        /// @todo Check if we really should do this.
                        // The quality of the gcontact table is mostly lower than the public contact
                        $public_contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link($contact["url"]), 'uid' => 0]);
-                       if (DBM::is_result($public_contact)) {
+                       if (DBA::isResult($public_contact)) {
                                logger("Update public contact ".$public_contact["id"], LOGGER_DEBUG);
 
                                Contact::updateAvatar($contact["photo"], 0, $public_contact["id"]);
@@ -1053,7 +1052,7 @@ class GContact
                        dbesc($last_update)
                );
 
-               if (!DBM::is_result($r)) {
+               if (!DBA::isResult($r)) {
                        return;
                }
 
@@ -1076,7 +1075,7 @@ class GContact
                        dbesc(NETWORK_DFRN)
                );
 
-               if (DBM::is_result($r)) {
+               if (DBA::isResult($r)) {
                        return dirname($r[0]['url']);
                }