diff options
author | Max Kostikov <max@kostikov.co> | 2020-12-04 14:33:34 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2020-12-04 14:33:34 +0100 |
commit | a9dd6d6bdbc27e11ffe71644670686d82e05420f (patch) | |
tree | 05dd57d1c3f2a8b7541598544b92dbbfe964c329 /Zotlabs/Module/Item.php | |
parent | c9ce562369556ae01044dfb91541c4e4ee35af9e (diff) | |
parent | 9c7ec55b4049599f3a61192eaf020e3a112dfa0e (diff) | |
download | volse-hubzilla-a9dd6d6bdbc27e11ffe71644670686d82e05420f.tar.gz volse-hubzilla-a9dd6d6bdbc27e11ffe71644670686d82e05420f.tar.bz2 volse-hubzilla-a9dd6d6bdbc27e11ffe71644670686d82e05420f.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!2
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 922a2ef06..7c438c309 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -20,6 +20,7 @@ use App; require_once('include/crypto.php'); require_once('include/items.php'); require_once('include/security.php'); +require_once('include/conversation.php'); /** @@ -300,6 +301,7 @@ class Item extends Controller { $parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0); $parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : ''); + $mode = (($_REQUEST['conv_mode'] === 'channel') ? 'channel' : 'network'); $remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false); $r = q("select * from xchan where xchan_hash = '%s' limit 1", @@ -1373,8 +1375,21 @@ class Item extends Controller { if($return_path) { goaway(z_root() . "/" . $return_path); } - - $json = array('success' => 1); + + if($mode === 'channel') + profile_load($channel['channel_address']); + + $item[] = $datarray; + $item[0]['owner'] = $owner_xchan; + $item[0]['author'] = $observer; + $item[0]['attach'] = json_encode($datarray['attach']); + + $json = [ + 'success' => 1, + 'id' => $post_id, + 'html' => conversation($item,$mode,true,'r_preview'), + ]; + if(x($_REQUEST,'jsreload') && strlen($_REQUEST['jsreload'])) $json['reload'] = z_root() . '/' . $_REQUEST['jsreload']; |