[Pkg-javascript-commits] [ltx] 137/469: connection rmStreamNs(): remove our xmlns for outgoing stanzas

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 3ca02632d8bf0b177d0a580e4627b9054098957e
Author: Astro <astro at spaceboyz.net>
Date:   Fri Sep 10 03:23:41 2010 +0200

    connection rmStreamNs(): remove our xmlns for outgoing stanzas
---
 lib/xmpp/connection.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/xmpp/connection.js b/lib/xmpp/connection.js
index e2b6b73..fc25298 100644
--- a/lib/xmpp/connection.js
+++ b/lib/xmpp/connection.js
@@ -172,13 +172,16 @@ Connection.prototype.addStreamNs = function(stanza) {
 
 /**
  * Remove superfluous xmlns that were aleady declared in
- * <stream:stream>
+ * our <stream:stream>
  */
 Connection.prototype.rmStreamNs = function(stanza) {
-    for(var k in this.streamNsAttrs) {
-        if (stanza.attrs[k] == this.streamNsAttrs[k])
-            delete stanza.attrs[k];
+    console.log({preRm:stanza.toString()});
+    for(var k in this.xmlns) {
+	var attr = k ? 'xmlns:' + k : 'xmlns';
+        if (stanza.attrs[attr] == this.xmlns[k])
+            delete stanza.attrs[attr];
     }
+    console.log({postRm:stanza.toString()});
     return stanza;
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list