]> cat aescling's git repositories - mastodon.git/blobdiff - app/javascript/mastodon/emoji.js
Add emoji autosuggest (#5053)
[mastodon.git] / app / javascript / mastodon / emoji.js
index 39123768a0d934c309d6f15b183f2f4f7016a8fa..d75f6f5982c288778aac8fdd934159518b511fc5 100644 (file)
@@ -48,25 +48,6 @@ const emojify = (str, customEmojis = {}) => {
 
 export default emojify;
 
-export const toCodePoint = (unicodeSurrogates, sep = '-') => {
-  let r = [], c = 0, p = 0, i = 0;
-
-  while (i < unicodeSurrogates.length) {
-    c = unicodeSurrogates.charCodeAt(i++);
-
-    if (p) {
-      r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16));
-      p = 0;
-    } else if (0xD800 <= c && c <= 0xDBFF) {
-      p = c;
-    } else {
-      r.push(c.toString(16));
-    }
-  }
-
-  return r.join(sep);
-};
-
 export const buildCustomEmojis = customEmojis => {
   const emojis = [];
 
@@ -76,12 +57,14 @@ export const buildCustomEmojis = customEmojis => {
     const name      = shortcode.replace(':', '');
 
     emojis.push({
+      id: name,
       name,
       short_names: [name],
       text: '',
       emoticons: [],
       keywords: [name],
       imageUrl: url,
+      custom: true,
     });
   });
 
This page took 0.031552 seconds and 3 git commands to generate.