Commit 2834e8d6 authored by JC Brand's avatar JC Brand

Bugfix. Single emoji messages don't display larger when restored from cache

parent 7511d8c3
...@@ -161,11 +161,13 @@ function convert (unicode) { ...@@ -161,11 +161,13 @@ function convert (unicode) {
} }
u.isSingleEmoji = function (str) { u.isSingleEmoji = function (str) {
str = str.trim();
if (!str || (str.length > 2 && !str.startsWith(':'))) { if (!str || (str.length > 2 && !str.startsWith(':'))) {
return; return;
} }
const result = _.flow(u.shortnameToUnicode, twemoji.default.parse)(str) const result = _.flow(u.shortnameToUnicode, twemoji.default.parse)(str)
return result.match(/<img class="emoji" draggable="false" alt=".*?" src=".*?\.png"\/>/); const match = result.match(/<img class="emoji" draggable="false" alt=".*?" src=".*?\.png"\/>/);
return match && match.length === 1;
} }
u.shortnameToUnicode = function (str) { u.shortnameToUnicode = function (str) {
......
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