diff options
author | zotlabs <mike@macgirvin.com> | 2019-08-31 14:04:10 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-08-31 14:04:10 -0700 |
commit | 1f8d29a22171138c90377007496c4af2033b1095 (patch) | |
tree | dc0a7a8f1ed82821ac73aaa9762a1e101305fb02 /Zotlabs/Lib/Activity.php | |
parent | 8cc40038375c33886f7c6f7d429c33a47eab8fb9 (diff) | |
download | volse-hubzilla-1f8d29a22171138c90377007496c4af2033b1095.tar.gz volse-hubzilla-1f8d29a22171138c90377007496c4af2033b1095.tar.bz2 volse-hubzilla-1f8d29a22171138c90377007496c4af2033b1095.zip |
improved conversion of emoji reactions from zot to zot6
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 12b6cbdfd..721ed10fd 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -516,6 +516,25 @@ class Activity { xchan_query($p,true); $p = fetch_post_tags($p,true); $i['obj'] = self::encode_item($p[0]); + + // convert to zot6 emoji reaction encoding which uses the target object to indicate the + // specific emoji instead of overloading the verb or type. + + $im = explode('#',$i['verb']); + if($im && count($im) > 1) + $emoji = $im[1]; + if(preg_match("/\[img(.*?)\](.*?)\[\/img\]/ism", $i['body'], $match)) { + $ln = $match[2]; + } + + $i['tgt_type'] = 'Image'; + + $i['target'] = [ + 'type' => 'Image', + 'name' => $emoji, + 'url' => (($ln) ? $ln : z_root() . '/images/emoji/' . $emoji . '.png') + ]; + } } |