} else {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
- this.irc_connection.register();
}
break;
case 'ACK':
} else {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
- this.irc_connection.register();
}
}
break;
if (this.irc_connection.cap.requested.length > 0) {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
- this.irc_connection.register();
}
break;
case 'LIST':
} else {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
- this.irc_connection.register();
}
},
'AWAY': function (command) {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
this.irc_connection.sasl = true;
- this.irc_connection.register();
},
'RPL_SASLLOGGEDIN': function (command) {
- // noop
+ if (this.irc_connection.cap_negotation === false) {
+ this.irc_connection.write('CAP END');
+ }
},
'ERR_SASLNOTAUTHORISED':function (command) {
this.irc_connection.write('CAP END');
this.irc_connection.cap_negotation = false;
- this.irc_connection.register();
},
'ERR_SASLABORTED': function (command) {
- // noop
+ this.irc_connection.write('CAP END');
+ this.irc_connection.cap_negotation = false;
},
'ERR_SASLALREADYAUTHED':function (command) {
// noop
this.write('CAP LS');
- this.registration_timeout = setTimeout(function () {
- that.register();
- }, 1000);
-
- this.connected = true;
- this.emit('connected');
-};
-
-IrcConnection.prototype.register = function () {
- if (this.registration_timeout !== null) {
- clearTimeout(this.registeration_timeout);
- this.registration_timeout = null;
- }
- if ((this.password) && (!this.sasl)) {
+ if (this.password) {
this.write('PASS ' + this.password);
}
this.write('NICK ' + this.nick);
this.write('USER ' + this.username + ' 0 0 :' + '[www.kiwiirc.com] ' + this.nick);
- if (this.cap_negotation) {
- this.write('CAP END');
- }
+
+ this.connected = true;
+ this.emit('connected');
};
-
function findWebIrc(connect_data) {
var webirc_pass = global.config.webirc_pass;
var ip_as_username = global.config.ip_as_username;