瀏覽代碼

fix(presence): do not escape xml values (#768)

When receiving presence, the XML is converted to JSON. In
the process, Strophe.getText is used, which calls its
xmlescape utility function. This is not desired as the
raw value is desired, especially for display name.

Note: this issue only affects presence as it is the only
place that call the helper packet2JSON, which is the only
place that calls Strophe.getText.
master
virtuacoplenny 6 年之前
父節點
當前提交
7b39059fba
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      modules/xmpp/ChatRoom.js

+ 4
- 1
modules/xmpp/ChatRoom.js 查看文件

@@ -29,7 +29,10 @@ export const parser = {
29 29
             const text = Strophe.getText(child);
30 30
 
31 31
             if (text) {
32
-                node.value = text;
32
+                // Using Strophe.getText will do work for traversing all direct
33
+                // child text nodes but returns an escaped value, which is not
34
+                // desirable at this point.
35
+                node.value = Strophe.xmlunescape(text);
33 36
             }
34 37
             nodes.push(node);
35 38
             this.packet2JSON(child, node.children);

Loading…
取消
儲存