diff options
author | Max Kostikov <max@kostikov.co> | 2019-09-03 14:33:09 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-09-03 14:33:09 +0200 |
commit | 914a096b42b741251a3132b74adf13e15c02cda3 (patch) | |
tree | deab2943634b0ccd14fa013404e27e04865dabdd /Zotlabs | |
parent | 5fa9dcbc7e940905cbcbf586731d83d27dd62fcf (diff) | |
parent | bbc98db6b4071296ea02cea1a8c89fd33b251b1c (diff) | |
download | volse-hubzilla-914a096b42b741251a3132b74adf13e15c02cda3.tar.gz volse-hubzilla-914a096b42b741251a3132b74adf13e15c02cda3.tar.bz2 volse-hubzilla-914a096b42b741251a3132b74adf13e15c02cda3.zip |
Merge branch 'dev' into 'dev'
improved conversion of emoji reactions from zot to zot6
See merge request hubzilla/core!1720
Diffstat (limited to 'Zotlabs')
-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') + ]; + } } |