Commit 64654260 authored by Dele Olajide's avatar Dele Olajide Committed by JC Brand

fix #2304 - Custom emojis (stickers) images not shown

parent 7803fd23
......@@ -36,6 +36,7 @@ Soon we'll deprecate the latter, so prepare now.
- #2220: fix rendering of emojis in case `use_system_emojis == false` (again).
- #2092: fixes room list update loop when having the `locked_muc_domain` truthy or `'hidden'`
- #2285: Rename config option `muc_hats_from_vcard` to [muc_hats](https://conversejs.org/docs/html/configuration.html#muc-hats). Now accepts a list instead of a boolean and allows for more flexible choices regarding user badges.
- #2304: Custom emojis (stickers) images not shown
- The `trusted` configuration setting has been removed in favor of two new settings:
[allow_user_trust_override](https://conversejs.org/docs/html/configuration.html#allow-user-trust-override)
[clear_cache_on_logout](https://conversejs.org/docs/html/configuration.html#clear-cache-on-logout)
......
......@@ -32,9 +32,6 @@ const ASCII_LIST = {
'=#':'1f636', ':)':'1f642', '=]':'1f642', '=)':'1f642', ':]':'1f642'
};
let shortnames_regex;
function toCodePoint(unicode_surrogates) {
const r = [];
let p = 0;
......@@ -154,7 +151,7 @@ export function getShortnameReferences (text) {
'To avoid this problem, first await the converse.emojis.initilaized_promise.'
);
}
const references = [...text.matchAll(shortnames_regex)].filter(ref => ref[0].length > 0);
const references = [...text.matchAll(converse.emojis.shortnames_regex)].filter(ref => ref[0].length > 0);
return references.map(ref => {
const cp = converse.emojis.by_sn[ref[0]].cp;
return {
......@@ -381,7 +378,7 @@ converse.plugins.add('converse-emoji', {
converse.emojis.list.sort((a, b) => a.sn < b.sn ? -1 : (a.sn > b.sn ? 1 : 0));
converse.emojis.shortnames = converse.emojis.list.map(m => m.sn);
const getShortNames = () => converse.emojis.shortnames.map(s => s.replace(/[+]/g, "\\$&")).join('|');
shortnames_regex = new RegExp(getShortNames(), "gi");
converse.emojis.shortnames_regex = new RegExp(getShortNames(), "gi");
converse.emojis.toned = getTonedEmojis();
converse.emojis.initialized_promise.resolve();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment