emojireaction compat

This commit is contained in:
zotlabs 2019-05-02 21:18:54 -07:00
parent 347e88dc65
commit f55f5fa92a
2 changed files with 12 additions and 0 deletions

View File

@ -566,6 +566,7 @@ class Activity {
return [];
}
if($i['target']) {
if(! is_array($i['target'])) {
$i['target'] = json_decode($i['target'],true);
@ -1527,6 +1528,9 @@ class Activity {
if($act->type === 'Announce') {
$content['content'] = sprintf( t('🔁 Repeated %1$s\'s %2$s'), $mention, $act->obj['type']);
}
if ($act->type === 'emojiReaction') {
$content['content'] = (($act->tgt && $act->tgt['type'] === 'Image') ? '[img=32x32]' . $act->tgt['url'] . '[/img]' : '&#x' . $act->tgt['name'] . ';');
}
}
if(! $s['created'])

View File

@ -59,6 +59,14 @@ class React extends \Zotlabs\Web\Controller {
$n['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n";
$n['author_xchan'] = $channel['channel_hash'];
$n['tgt_type'] = 'Image';
$n['target'] = [
'type' => 'Image',
'name' => $emoji,
'url' => z_root() . '/images/emoji/' . $emoji . '.png'
];
$x = item_store($n);
retain_item($postid);