aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Activity.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 089fb3687..ddd91f60b 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2187,9 +2187,22 @@ class Activity {
if (in_array($act->type, ['EmojiReaction', 'EmojiReact'])) {
// Pleroma reactions
$t = trim(self::get_textfield($act->data, 'content'));
+
+ // Unicode emojis
if (mb_strlen($t) === 1) {
$content['content'] = $t;
}
+ // Custom emojis
+ elseif (preg_match('/^[:].*[:]$/i', $t, $match)) {
+ $content['content'] = $match[0];
+ if (isset($act->data['tag']) && is_array($act->data['tag'])) {
+ foreach ($act->data['tag'] as $tag) {
+ if ($tag['type'] === 'Emoji' && $tag['name'] === trim($match[0], ':')) {
+ $content['content'] = '[img=32x32]' . $tag['id'] . '[/img]';
+ }
+ }
+ }
+ }
}
}