mirror of
https://github.com/friendica/friendica
synced 2025-04-23 13:50:11 +00:00
There is now a "global" field in the item table that tells if this item is present as global copy as well.
This commit is contained in:
parent
2260415ca9
commit
ea06a1ec45
4 changed files with 25 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue