diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-26 18:29:24 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-26 18:29:24 -0800 |
commit | 0e91810ed6764fbbee54e918711bfb45a1d9fd72 (patch) | |
tree | f6c3d995e438057161ecdd7f0afd479df5a751e6 /Zotlabs/Module/Item.php | |
parent | e1fdac32782de11e443c7398ff3fb9870fa9b2d9 (diff) | |
download | volse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.tar.gz volse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.tar.bz2 volse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.zip |
pubstream comments and a few other bugfixes that were discovered along the way
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index ecbefa1c2..2528645f3 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -59,6 +59,7 @@ class Item extends \Zotlabs\Web\Controller { $profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0); require_once('include/channel.php'); + $sys = get_sys_channel(); if($sys && $profile_uid && ($sys['channel_id'] == $profile_uid) && is_site_admin()) { $uid = intval($sys['channel_id']); @@ -171,7 +172,7 @@ class Item extends \Zotlabs\Web\Controller { ); } // if this isn't the real parent of the conversation, find it - if($r !== false && count($r)) { + if($r) { $parid = $r[0]['parent']; $parent_mid = $r[0]['mid']; if($r[0]['id'] != $r[0]['parent']) { @@ -179,9 +180,16 @@ class Item extends \Zotlabs\Web\Controller { intval($parid) ); } + + // if interacting with a pubstream item, + // create a copy of the parent in your stream + + if($r[0]['uid'] === $sys['channel_id'] && local_channel()) { + $r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ]; + } } - - if(($r === false) || (! count($r))) { + + if(! $r) { notice( t('Unable to locate original post.') . EOL); if($api_source) return ( [ 'success' => false, 'message' => 'invalid post id' ] ); @@ -189,15 +197,12 @@ class Item extends \Zotlabs\Web\Controller { goaway(z_root() . "/" . $return_path ); killme(); } - - // can_comment_on_post() needs info from the following xchan_query - // This may be from the discover tab which means we need to correct the effective uid - xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel())); - + xchan_query($r,true); + $parent_item = $r[0]; $parent = $r[0]['id']; - + // multi-level threading - preserve the info but re-parent to our single level threading $thr_parent = $parent_mid; |