aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-02 20:31:34 -0700
committerredmatrix <git@macgirvin.com>2016-06-02 20:31:34 -0700
commit390ce207db5b2e0a68e82cb80b6667431e07d31c (patch)
treedc6f97fbbf74d881f08bbb206b05aa75ca421463 /Zotlabs
parentf9075e2a2feca0f37fdf568be6e6e53460aa9034 (diff)
downloadvolse-hubzilla-390ce207db5b2e0a68e82cb80b6667431e07d31c.tar.gz
volse-hubzilla-390ce207db5b2e0a68e82cb80b6667431e07d31c.tar.bz2
volse-hubzilla-390ce207db5b2e0a68e82cb80b6667431e07d31c.zip
experimental emoji support
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/React.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php
new file mode 100644
index 000000000..85a1e2350
--- /dev/null
+++ b/Zotlabs/Module/React.php
@@ -0,0 +1,50 @@
+<?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['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