aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-09 20:53:18 +0000
committerMario <mario@mariovavti.com>2024-03-09 20:53:18 +0000
commit46fa26502b285213f3438abb1e3bd1482eb55bf5 (patch)
treec40ee65fc9da26319e26758c80339124f5247bea /Zotlabs/Module/Item.php
parentba1e705c6154d347000ab6c92ef59f7f6f60e886 (diff)
downloadvolse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.tar.gz
volse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.tar.bz2
volse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.zip
more work on emojis
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 5c802f557..b158ed4e0 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -938,6 +938,30 @@ class Item extends Controller {
}
}
+ if (preg_match_all('/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/', $body, $match)) {
+ // emoji shortcodes
+ $emojis = get_emojis();
+ foreach ($match[0] as $mtch) {
+ $shortname = trim($mtch, ':');
+
+ if (!isset($emojis[$shortname])) {
+ continue;
+ }
+
+ $emoji = $emojis[$shortname];
+
+ $post_tags[] = [
+ 'uid' => $profile_uid,
+ 'ttype' => TERM_EMOJI,
+ 'otype' => TERM_OBJ_POST,
+ 'term' => trim($mtch),
+ 'url' => z_root() . '/emoji/' . $shortname,
+ 'imgurl' => z_root() . '/' . $emoji['filepath']
+ ];
+ }
+ }
+
+
// BBCODE end alert
}
@@ -958,6 +982,10 @@ class Item extends Controller {
}
}
+
+
+
+
if ($orig_post) {
// preserve original tags
$t = q("select * from term where oid = %d and otype = %d and uid = %d and ttype in ( %d, %d, %d )",