]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
There is now a "global" field in the item table that tells if this item is present...
[friendica.git] / include / items.php
index 8f9eb5aa6454353d78bb803de1ea7c5b831485e3..3ec476ad6bab9ea1aaa69609dcc3f42cbfbdc731 100644 (file)
@@ -1346,6 +1346,17 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
                return 0;
        }
 
+       // Is this item available in the global items (with uid=0)?
+       if ($arr["uid"] == 0) {
+               $arr["global"] = true;
+
+               q("UPDATE `item` SET `global` = 1 WHERE `guid` = '%s'", dbesc($arr["guid"]));
+       }  else {
+               $isglobal = q("SELECT `global` FROM `item` WHERE `uid` = 0 AND `guid` = '%s'", dbesc($arr["guid"]));
+
+               $arr["global"] = (count($isglobal) > 0);
+       }
+
        // Fill the cache field
        put_item_in_cache($arr);