aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/React.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-06-04 05:45:53 -0400
committerAndrew Manning <tamanning@zoho.com>2016-06-04 05:45:53 -0400
commitc08f428b5e7979e87250c2b0a30cd16344b395d9 (patch)
tree4da053975141628a0ead27f5a50606e9aec4fc27 /Zotlabs/Module/React.php
parentb93e398674b375a3b14718fc6dd2a815aad9b387 (diff)
parent20a79c7acf1850f431f4fd52972ea0b6acf8ce0c (diff)
downloadvolse-hubzilla-c08f428b5e7979e87250c2b0a30cd16344b395d9.tar.gz
volse-hubzilla-c08f428b5e7979e87250c2b0a30cd16344b395d9.tar.bz2
volse-hubzilla-c08f428b5e7979e87250c2b0a30cd16344b395d9.zip
Merge remote-tracking branch 'upstream/dev' into wiki
Diffstat (limited to 'Zotlabs/Module/React.php')
-rw-r--r--Zotlabs/Module/React.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php
new file mode 100644
index 000000000..28c7c239c
--- /dev/null
+++ b/Zotlabs/Module/React.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Zotlabs\Module;
+
+
+class React extends \Zotlabs\Web\Controller {
+
+ function get() {
+ if(! local_channel())
+ return;
+
+ $postid = $_REQUEST['postid'];
+
+ if(! $postid)
+ return;
+
+ $emoji = $_REQUEST['emoji'];
+ if($_REQUEST['emoji']) {
+
+ $i = q("select * from item where id = %d and uid = %d",
+ intval($postid),
+ intval(local_channel())
+ );
+
+ if(! $i)
+ return;
+
+ $channel = \App::get_channel();
+
+ $n = array();
+ $n['aid'] = $channel['channel_account_id'];
+ $n['uid'] = $channel['channel_id'];
+ $n['item_origin'] = true;
+ $n['parent'] = $postid;
+ $n['parent_mid'] = $i[0]['mid'];
+ $n['mid'] = item_message_id();
+ $n['verb'] = ACTIVITY_REACT . '#' . $emoji;
+ $n['body'] = "\n\n[zmg]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n";
+ $n['author_xchan'] = $channel['channel_hash'];
+
+ $x = item_store($n);
+ if($x['success']) {
+ $nid = $x['item_id'];
+ \Zotlabs\Daemon\Master::Summon(array('Notifier','like',$nid));
+ }
+
+ }
+
+ }
+
+} \ No newline at end of file