aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-24 18:23:53 -0800
committerzotlabs <mike@macgirvin.com>2017-11-24 18:23:53 -0800
commit08900b730bd39c00e399696472d904c1d5e4ef0b (patch)
tree96cbb31a9271c5625bbbe78c241a522ca8041346 /include
parent9dd545f4205a0f543a883422135e560c4ec74ad1 (diff)
downloadvolse-hubzilla-08900b730bd39c00e399696472d904c1d5e4ef0b.tar.gz
volse-hubzilla-08900b730bd39c00e399696472d904c1d5e4ef0b.tar.bz2
volse-hubzilla-08900b730bd39c00e399696472d904c1d5e4ef0b.zip
this may fix pubstream comments/likes
Diffstat (limited to 'include')
-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,