aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/React.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-26 18:29:24 -0800
committerzotlabs <mike@macgirvin.com>2017-11-26 18:29:24 -0800
commit0e91810ed6764fbbee54e918711bfb45a1d9fd72 (patch)
treef6c3d995e438057161ecdd7f0afd479df5a751e6 /Zotlabs/Module/React.php
parente1fdac32782de11e443c7398ff3fb9870fa9b2d9 (diff)
downloadvolse-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/React.php')
-rw-r--r--Zotlabs/Module/React.php25
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'];