瀏覽代碼

Merge pull request #1029 from ChaosKid42/send_emojis_as_unicode_muc

send emojis as unicode also in MUCs
JC Brand 7 年之前
父節點
當前提交
1a518f3df3
共有 2 個文件被更改,包括 5 次插入0 次删除
  1. 2 0
      CHANGES.md
  2. 3 0
      src/converse-muc.js

+ 2 - 0
CHANGES.md

@@ -4,6 +4,8 @@
 
 - Avoid `eval` (via `_.template` from lodash).
 - Don't show bookmark toggles when PEP bookmarking not supported by the XMPP server.
+- Emojis are now sent in unicode instead of short names (also in MUCs)
+
 
 ### Bugfixes
 

+ 3 - 0
src/converse-muc.js

@@ -13,6 +13,7 @@
     define([
             "form-utils",
             "converse-core",
+            "emojione",
             "lodash.fp",
             "tpl!chatarea",
             "tpl!chatroom",
@@ -44,6 +45,7 @@
 }(this, function (
             u,
             converse,
+            emojione,
             fp,
             tpl_chatarea,
             tpl_chatroom,
@@ -969,6 +971,7 @@
                      * Parameters:
                      *  (String) text: The message text to be sent.
                      */
+                    text = emojione.shortnameToUnicode(text)
                     const msgid = _converse.connection.getUniqueId();
                     const msg = $msg({
                         to: this.model.get('jid'),