diff options
author | mrjive <mrjive@mrjive.it> | 2018-01-16 11:45:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-16 11:45:01 +0100 |
commit | e81949bb095448881ce83605a50454d0c3c40782 (patch) | |
tree | bd15059a020152b5dc59c265e22a27251efe0de4 /Zotlabs/Module/React.php | |
parent | b4f8f4df7bc5cc8a74240506cd536224cb31e114 (diff) | |
parent | 9aadcb0bd40a8f773dc164f7dadc8c238fff9954 (diff) | |
download | volse-hubzilla-e81949bb095448881ce83605a50454d0c3c40782.tar.gz volse-hubzilla-e81949bb095448881ce83605a50454d0c3c40782.tar.bz2 volse-hubzilla-e81949bb095448881ce83605a50454d0c3c40782.zip |
Merge pull request #7 from redmatrix/dev
Dev
Diffstat (limited to 'Zotlabs/Module/React.php')
-rw-r--r-- | Zotlabs/Module/React.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php index 6cd79c952..6473317c7 100644 --- a/Zotlabs/Module/React.php +++ b/Zotlabs/Module/React.php @@ -6,15 +6,21 @@ namespace Zotlabs\Module; class React extends \Zotlabs\Web\Controller { function get() { + if(! local_channel()) return; + $sys = get_sys_channel(); + $channel = \App::get_channel(); + $postid = $_REQUEST['postid']; if(! $postid) return; $emoji = $_REQUEST['emoji']; + + if($_REQUEST['emoji']) { $i = q("select * from item where id = %d and uid = %d", @@ -22,10 +28,22 @@ class React extends \Zotlabs\Web\Controller { intval(local_channel()) ); - if(! $i) + if(! $i) { + $i = q("select * from item where id = %d and uid = %d", + intval($postid), + intval($sys['channel_id']) + ); + + if($i) { + $i = [ copy_of_pubitem($channel, $i[0]['mid']) ]; + $postid = (($i) ? $i[0]['id'] : 0); + } + } + + if(! $i) { return; + } - $channel = \App::get_channel(); $n = array(); $n['aid'] = $channel['channel_account_id']; @@ -40,8 +58,7 @@ class React extends \Zotlabs\Web\Controller { $x = item_store($n); - if(local_channel()) - retain_item($postid); + retain_item($postid); if($x['success']) { $nid = $x['item_id']; |