Permalink
Browse files

Move auth:success handler from transport to the main client.

The transport doesn't emit that event.
  • Loading branch information...
legastero committed Jul 15, 2017
1 parent 160c1b1 commit 933fc1452e234ffcf3cd96bb324aeefdcc58afbf
Showing with 6 additions and 4 deletions.
  1. +6 −0 lib/client.js
  2. +0 −4 lib/transports/bosh.js
View
@@ -109,6 +109,12 @@ function Client(opts) {
self.releaseGroup('connection');
});
this.on('auth:success', function () {
if (self.transport) {
self.transport.authenticated = true;
}
});
this.on('iq', function (iq) {
var iqType = iq.type;
var xmlChildCount = iq._xmlChildCount;
View
@@ -85,10 +85,6 @@ function BOSHConnection(sm, stanzas) {
self.sid = '';
self.authenticated = false;
self.on('auth:success', function() {
self.authenticated = true;
});
self.on('raw:incoming', function (data) {
data = data.trim();
if (data === '') {

0 comments on commit 933fc14

Please sign in to comment.