Fix not all emoji-only messages being detected as jumbo emoji (#368)
authorginnyTheCat <ginnythecat@lelux.net>
Fri, 11 Mar 2022 05:03:58 +0000 (06:03 +0100)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 05:03:58 +0000 (10:33 +0530)
src/app/molecules/message/Message.jsx

index c1ceda87b0182d50e8dcffe1f1397e2a63718158..9c596e17c932984351d931446cb6e85d6516e7fb 100644 (file)
@@ -201,10 +201,10 @@ const MessageBody = React.memo(({
     // Count the number of emojis
     const nEmojis = content.filter((e) => e.type === 'img').length;
 
-    // Make sure there's no text besides whitespace
+    // Make sure there's no text besides whitespace and variation selector U+FE0F
     if (nEmojis <= 10 && content.every((element) => (
       (typeof element === 'object' && element.type === 'img')
-      || (typeof element === 'string' && /^\s*$/g.test(element))
+      || (typeof element === 'string' && /^[\s\ufe0f]*$/g.test(element))
     ))) {
       emojiOnly = true;
     }