]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
New function to detect heavily used indexes
[friendica.git] / include / items.php
index 327096341c942cc4a355fac84691f6bdec39859c..fa4f3290b142090168fbd36222e13d9f4b75840f 100644 (file)
@@ -955,12 +955,14 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
 
                $r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
                if ((dbm::is_result($r)) && (count($r) == 1)) {
-                       if ($notify)
+                       if ($notify) {
                                call_hooks('post_local_end', $r[0]);
-                       else
+                       } else {
                                call_hooks('post_remote_end', $r[0]);
-               } else
+                       }
+               } else {
                        logger('item_store: new item not found in DB, id ' . $current_post);
+               }
        }
 
        if ($arr['parent-uri'] === $arr['uri']) {
@@ -994,8 +996,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
 
        check_item_notification($current_post, $uid);
 
-       if ($notify)
+       if ($notify) {
                proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post);
+       }
 
        return $current_post;
 }
@@ -1260,7 +1263,7 @@ function tag_deliver($uid,$item_id) {
        $c = q("select name, url, thumb from contact where self = 1 and uid = %d limit 1",
                intval($u[0]['uid'])
        );
-       if (! count($c)) {
+       if (! dbm::is_result($c)) {
                return;
        }
 
@@ -1293,8 +1296,6 @@ function tag_deliver($uid,$item_id) {
 
 function tgroup_check($uid,$item) {
 
-       $a = get_app();
-
        $mention = false;
 
        // check that the message originated elsewhere and is a top-level post