aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-25 07:17:52 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-25 07:17:52 +0100
commit2108173e74c12ce590c87e673d3455f7a9b18de8 (patch)
tree2fc06a9de42ac30c95aab864ecfd0fe2e7681d0c /include/items.php
parentb03545f89939ef1c13ca7f5a950d52fcb7f2313f (diff)
parent08900b730bd39c00e399696472d904c1d5e4ef0b (diff)
downloadvolse-hubzilla-2108173e74c12ce590c87e673d3455f7a9b18de8.tar.gz
volse-hubzilla-2108173e74c12ce590c87e673d3455f7a9b18de8.tar.bz2
volse-hubzilla-2108173e74c12ce590c87e673d3455f7a9b18de8.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 654cc5de3..042deed1b 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1749,6 +1749,22 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
intval($arr['uid'])
);
+ // perhaps the system channel owns the post and it's a pubstream item
+
+ if(! $r) {
+ $s = q("select channel_id from channel where channel_system = 1 limit 1");
+ if($s) {
+ $r = q("SELECT * FROM item WHERE mid = '%s' AND uid = %d ORDER BY id ASC LIMIT 1",
+ dbesc($arr['parent_mid']),
+ intval($s[0]['channel_id'])
+ );
+ }
+ if($r) {
+ $arr['uid'] = $r[0]['uid'];
+ $arr['aid'] = 0;
+ }
+ }
+
if($r) {
// in case item_store was killed before the parent's parent attribute got set,