Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/candy-chat/candy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Langfeld <ben@langfeld.me>2016-09-24 02:40:38 +0300
committerGitHub <noreply@github.com>2016-09-24 02:40:38 +0300
commitb8d15b7a9d6ffb181b1bfbe72a106546cb1c6910 (patch)
tree87162c7c015262e9dd3213b9bab79a84f95d9c8b
parent5574d2c682bd167e17136b4c7dcb8d816d08a94c (diff)
parent3c51624ea93572aedda7d9a1e7a3c439d8bf7da3 (diff)
Merge pull request #484 from guusdk/no-xhtml
Prevent XHTML parsing when XHTML is not enabled.
-rw-r--r--src/core/event.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/event.js b/src/core/event.js
index 9486ede..a2eb12c 100644
--- a/src/core/event.js
+++ b/src/core/event.js
@@ -852,10 +852,12 @@ Candy.Core.Event = (function(self, Strophe, $) {
}
}
- var xhtmlChild = msg.children('html[xmlns="' + Strophe.NS.XHTML_IM + '"]');
- if(xhtmlChild.length > 0) {
- var xhtmlMessage = $($('<div>').append(xhtmlChild.children('body').first().contents()).html());
- message.xhtmlMessage = xhtmlMessage;
+ if ( Candy.View.getOptions().enableXHTML === true ) {
+ var xhtmlChild = msg.children('html[xmlns="' + Strophe.NS.XHTML_IM + '"]');
+ if(xhtmlChild.length > 0) {
+ var xhtmlMessage = $($('<div>').append(xhtmlChild.children('body').first().contents()).html());
+ message.xhtmlMessage = xhtmlMessage;
+ }
}
self.Jabber.Room._checkForChatStateNotification(msg, roomJid, name);