]> git.mxchange.org Git - friendica.git/blobdiff - include/threads.php
This merge brings back dbm::is_result() where I could find it.
[friendica.git] / include / threads.php
index 2e02e7ada3290ae0ecb690cad1d6ca912e307379..2b1b27679b3c3b17934b8985e5a7bfd50fe00b25 100644 (file)
@@ -85,12 +85,12 @@ function add_shadow_entry($item) {
 
        // Is there a shadow parent?
        $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = 0 LIMIT 1", dbesc($item['parent-uri']));
-       if (!count($r))
+       if (!dbm::is_result($r))
                return;
 
        // Is there already a shadow entry?
        $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = 0 LIMIT 1", dbesc($item['uri']));
-       if (count($r))
+       if (dbm::is_result($r))
                return;
 
        // Preparing public shadow (removing user specific data)
@@ -108,7 +108,7 @@ function add_shadow_entry($item) {
 function update_thread_uri($itemuri, $uid) {
        $messages = q("SELECT `id` FROM `item` WHERE uri ='%s' AND uid=%d", dbesc($itemuri), intval($uid));
 
-       if(count($messages))
+       if(dbm::is_result($messages))
                foreach ($messages as $message)
                        update_thread($message["id"]);
 }
@@ -117,7 +117,7 @@ function update_thread($itemid, $setmention = false) {
        $items = q("SELECT `uid`, `guid`, `title`, `body`, `created`, `edited`, `commented`, `received`, `changed`, `wall`, `private`, `pubmail`, `moderated`, `visible`, `spam`, `starred`, `bookmark`, `contact-id`, `gcontact-id`,
                        `deleted`, `origin`, `forum_mode`, `network`, `rendered-html`, `rendered-hash` FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid));
 
-       if (!$items)
+       if (!dbm::is_result($items))
                return;
 
        $item = $items[0];