vn-verdnaturachat/patches/emoji-toolkit+5.0.4.patch

36 lines
1.6 KiB
Diff
Raw Normal View History

diff --git a/node_modules/emoji-toolkit/lib/js/joypixels.js b/node_modules/emoji-toolkit/lib/js/joypixels.js
index 8e696e6..f2998b9 100644
--- a/node_modules/emoji-toolkit/lib/js/joypixels.js
+++ b/node_modules/emoji-toolkit/lib/js/joypixels.js
@@ -111,6 +111,7 @@
':L':'1f615',
'=L':'1f615',
':P':'1f61b',
+ ':p':'1f61b',
'=P':'1f61b',
':b':'1f61b',
':O':'1f62e',
@@ -245,12 +246,19 @@
// replace regular shortnames first
var unicode,fname;
str = str.replace(ns.regShortNames, function(shortname) {
- if( (typeof shortname === 'undefined') || (shortname === '') || (!(shortname in ns.emojiList)) ) {
- // if the shortname doesnt exist just return the entire matchhju
+ if( (typeof shortname === 'undefined') || (shortname === '') || (ns.shortnames.indexOf(shortname) === -1) ) {
+ // if the shortname doesnt exist just return the entire match
return shortname;
}
+ if (!ns.emojiList[shortname]) {
+ for ( var emoji in ns.emojiList ) {
+ if (!ns.emojiList.hasOwnProperty(emoji) || (emoji === '')) continue;
+ if (ns.emojiList[emoji].shortnames.indexOf(shortname) === -1) continue;
+ shortname = emoji;
+ break;
+ }
+ }
unicode = ns.emojiList[shortname].uc_full.toUpperCase();
- fname = ns.emojiList[shortname].uc_base;
return ns.convert(unicode);
});