Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Linking registration reply to callback #92

Closed
wants to merge 1 commit into from

2 participants

@kartikrustagi

On receiving a registration stanza we enter C2SStream.prototype.onRegistration and we were sending success reply for stanza.attrs.type === 'set' case delinking it to the value of 'error' in the callback to 'register' event.
Making self.send(reply) part of callback mitigates this bug. 

@kartikrustagi kartikrustagi Linking registration reply to callback
On receiving a registration stanza we enter C2SStream.prototype.onRegistration and we were sending success reply for stanza.attrs.type === 'set' case delinking it to the value of 'error' in the callback to 'register' event.
Making self.send(reply) part of callback mitigates this bug. 
2b4d6ff
@lloydwatkin
Owner

It looks like this is already implemented in lib/xmpp/c2s.js` so I am closing this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 28, 2012
  1. @kartikrustagi

    Linking registration reply to callback

    kartikrustagi authored
    On receiving a registration stanza we enter C2SStream.prototype.onRegistration and we were sending success reply for stanza.attrs.type === 'set' case delinking it to the value of 'error' in the callback to 'register' event.
    Making self.send(reply) part of callback mitigates this bug. 
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/xmpp/c2s.js
View
3  lib/xmpp/c2s.js
@@ -213,6 +213,7 @@ C2SStream.prototype.onRegistration = function(stanza) {
c("instructions").t("Choose a username and password for use with this service. ").up().
c("username").up().
c("password");
+ self.send(reply);
}
else if (stanza.attrs.type === 'set') {
var jid = new JID(register.getChildText('username'), this.server.options.domain)
@@ -229,9 +230,9 @@ C2SStream.prototype.onRegistration = function(stanza) {
reply.attrs.type = "error";
reply.c("error", { code: '' + error.code, type: error.type }).c('text', { xmlns: "urn:ietf:params:xml:ns:xmpp-stanzas" }).t(error.message);
}
+ self.send(reply);
});
}
- self.send(reply);
};
C2SStream.prototype.onBind = function(stanza) {
Something went wrong with that request. Please try again.