[Pkg-javascript-commits] [ltx] 68/469: server: reorder dialback matching to allow empty keys

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:02 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 58574fad7011a96084d78e13e684c509630e52ad
Author: Astro <astro at spaceboyz.net>
Date:   Sun Sep 5 17:59:25 2010 +0200

    server: reorder dialback matching to allow empty keys
    
    No idea if that makes sense but ejabberd sent this in an erroneous
    situation. :-)
---
 lib/xmpp/server.js | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/lib/xmpp/server.js b/lib/xmpp/server.js
index c1967e8..52f74a6 100644
--- a/lib/xmpp/server.js
+++ b/lib/xmpp/server.js
@@ -20,20 +20,19 @@ function initServer(self) {
 	var key = stanza.getText();
 
 	if (stanza.is('result', NS_DIALBACK) &&
-	    stanza.attrs.from && stanza.attrs.to &&
-	    key.length > 0) {
+		   stanza.attrs.from && stanza.attrs.to &&
+		   stanza.attrs.type) {
 
-	    self.emit('dialbackKey',
+	    self.emit('dialbackResult',
 		      stanza.attrs.from, stanza.attrs.to,
-		      key);
+		      stanza.attrs.type == 'valid');
 
-	} else if (stanza.is('verify', NS_DIALBACK) &&
-		   stanza.attrs.from && stanza.attrs.to &&
-		   stanza.attrs.id && key.length > 0) {
+	} else if (stanza.is('result', NS_DIALBACK) &&
+	    stanza.attrs.from && stanza.attrs.to) {
 
-	    self.emit('dialbackVerify',
+	    self.emit('dialbackKey',
 		      stanza.attrs.from, stanza.attrs.to,
-		      stanza.attrs.id, key);
+		      key);
 
 	} else if (stanza.is('verify', NS_DIALBACK) &&
 		   stanza.attrs.from && stanza.attrs.to &&
@@ -43,13 +42,14 @@ function initServer(self) {
 		      stanza.attrs.from, stanza.attrs.to,
 		      stanza.attrs.id, stanza.attrs.type == 'valid');
 
-	} else if (stanza.is('result', NS_DIALBACK) &&
+	} else if (stanza.is('verify', NS_DIALBACK) &&
 		   stanza.attrs.from && stanza.attrs.to &&
-		   stanza.attrs.type) {
+		   stanza.attrs.id) {
 
-	    self.emit('dialbackResult',
+	    self.emit('dialbackVerify',
 		      stanza.attrs.from, stanza.attrs.to,
-		      stanza.attrs.type == 'valid');
+		      stanza.attrs.id, key);
+
 	} else
 	    self.emit('stanza', 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