ERR_PASSWORDMISMATCH; IrcServer disposing
authorDarren <darren@darrenwhitlen.com>
Thu, 31 Jan 2013 12:54:15 +0000 (12:54 +0000)
committerDarren <darren@darrenwhitlen.com>
Thu, 31 Jan 2013 14:58:44 +0000 (14:58 +0000)
server/irc/commands.js
server/irc/connection.js
server/irc/server.js

index 9f32251d9b468ffebf37f5bb6f45cf376149c59e..1678b726ee4bdd80f52e05bd7c3d26fbebe5bfe5 100644 (file)
@@ -45,6 +45,7 @@ var irc_numerics = {
     ERR_NICKNAMEINUSE:      '433',
     ERR_USERNOTINCHANNEL:   '441',
     ERR_NOTONCHANNEL:       '442',
+    ERR_PASSWDMISMATCH:     '464',
     ERR_NOTREGISTERED:      '451',
     ERR_LINKCHANNEL:        '470',
     ERR_CHANNELISFULL:      '471',
@@ -570,6 +571,9 @@ var listeners = {
             reason: command.trailing
         });
     },
+    ERR_PASSWDMISMATCH: function (command) {
+        this.irc_connection.emit('server:' + this.irc_connection.irc_host.hostname + ':password_mismatch', {});
+    },
     ERR_LINKCHANNEL: function (command) {
         this.irc_connection.emit('server:' + this.irc_connection.irc_host.hostname + ':channel_redirect', {
             from: command.params[1],
index 5cf64a4b750a285ff01185c1ed449f3de1201bdd..738a72e03c561f8a1b14e561b43768c7c6e5ffae 100644 (file)
@@ -188,6 +188,11 @@ IrcConnection.prototype.dispose = function () {
     });
     this.irc_users = null;
     this.irc_channels = null;
+    this.irc_users = undefined;
+    this.irc_channels = undefined;
+
+    this.server.dispose();
+    this.server = undefined;
 
     EventBinder.unbindIrcEvents('', this.irc_events, this);
 
index 2a431e6796421267713131df622747372b2d4163..2478e202a85b1b4c29d54e07409f4f66c7aca152 100755 (executable)
@@ -19,7 +19,8 @@ var IrcServer = function (irc_connection, host, port) {
         motd_start:             onMotdStart,
         motd:                   onMotd,
         motd_end:               onMotdEnd,
-        error:                  onError,
+        error:                  onError_,
+        password_mismatch:      onPasswordMismatch,
         channel_redirect:       onChannelRedirect,
         no_such_nick:           onNoSuchNick,
         cannot_send_to_channel: onCannotSendToChan,
@@ -33,7 +34,7 @@ var IrcServer = function (irc_connection, host, port) {
         chanop_privs_needed:    onChanopPrivsNeeded,
         nickname_in_use:        onNicknameInUse
     };
-    EventBinder.bindIrcEvents('server:' + this.host, this.irc_events, this, irc_connection);
+    EventBinder.bindIrcEvents('server:' + this.host, this.irc_events, this, this.irc_connection);
     
 
 };
@@ -43,7 +44,7 @@ module.exports = IrcServer;
 
 
 IrcServer.prototype.dispose = function (){
-    EventBinder.unbindIrcEvents('server:' + this.host, this.irc_events);
+    EventBinder.unbindIrcEvents('server:' + this.host, this.irc_events, this.irc_connection);
     this.irc_connection = undefined;
 };
 
@@ -117,13 +118,19 @@ function onMotdEnd(event) {
     });
 };
 
-function onError(event) {
+function onError_(event) {
     this.irc_connection.clientEvent('irc_error', {
         error: 'error',
         reason: event.reason
     });
 };
 
+function onPasswordMismatch(event) {
+    this.irc_connection.clientEvent('irc_error', {
+        error: 'password_mismatch'
+    });
+}
+
 function onChannelRedirect(event) {
     this.irc_connection.clientEvent('channel_redirect', {
         from: event.from,