aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-08 08:42:50 +0000
committerMario <mario@mariovavti.com>2024-03-08 08:42:50 +0000
commit45b1be8962903868c5d3a5e98ff09bd74bbecc85 (patch)
tree97f0594d86662fa40fc3f71012c2714bb3fb228a /Zotlabs/Lib/Activity.php
parentfe9ca30c5e3061e1f8a7def634392d9fc267790e (diff)
downloadvolse-hubzilla-45b1be8962903868c5d3a5e98ff09bd74bbecc85.tar.gz
volse-hubzilla-45b1be8962903868c5d3a5e98ff09bd74bbecc85.tar.bz2
volse-hubzilla-45b1be8962903868c5d3a5e98ff09bd74bbecc85.zip
inbound support for custom emojis
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 45cb1d803..29b99fab5 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2183,18 +2183,6 @@ class Activity {
if (grapheme_strlen($t) === 1) {
$content['content'] = $t;
}
-
- // Custom emojis
- $e = self::decode_taxonomy($act->data);
-
- if ($e) {
- $s['term'] = $e;
- foreach ($e as $ee) {
- if ($ee['ttype'] === TERM_EMOJI) {
- $content['content'] = '[img=32x32]' . $ee['url'] . '[/img]';
- }
- }
- }
}
}
@@ -2894,8 +2882,17 @@ class Activity {
}
}
+ if (!PConfig::Get($channel['channel_id'], 'system', 'no_smilies')) {
+ foreach ($item['term'] as $t) {
+ if ($t['ttype'] === TERM_EMOJI) {
+ $item['body'] = str_replace($t['term'], '[img class="smiley emoji custom-emoji" alt="' . $t['term'] . '" title="' . $t['term'] . '"]' . $t['url'] . '[/img]', $item['body']);
+ }
+ }
+ }
+
// TODO: not implemented
// self::rewrite_mentions($item);
+
$r = q("select id, created, edited from item where mid = '%s' and uid = %d limit 1",
dbesc($item['mid']),
intval($item['uid'])