IrcConnection specific quit_message
authorDarren <darren@darrenwhitlen.com>
Thu, 2 Oct 2014 16:37:31 +0000 (17:37 +0100)
committerDarren <darren@darrenwhitlen.com>
Thu, 2 Oct 2014 16:37:31 +0000 (17:37 +0100)
server/irc/connection.js
server/irc/state.js

index 9584ffa45b2fa420ae0603771253bac1765ae4ed..05340bc6009bd01a2471754815494a250437defb 100644 (file)
@@ -67,6 +67,7 @@ var IrcConnection = function (hostname, port, ssl, nick, user, options, state, c
     this.username = this.nick.replace(/[^0-9a-zA-Z\-_.\/]/, '');
     this.gecos = ''; // Users real-name. Uses default from config if empty
     this.password = options.password || '';
+    this.quit_message = ''; // Uses default from config if empty
 
     // Set the passed encoding. or the default if none giving or it fails
     if (!options.encoding || !this.setEncoding(options.encoding)) {
index 32e7cfc4dacc6540c16b8b846b2cc9d8ed09d977..047d0a9179a7772412783d9bd26e7fb81e3bd4e6 100755 (executable)
@@ -18,7 +18,7 @@ var State = function (client, save_state) {
         if (!that.save_state) {
             _.each(that.irc_connections, function (irc_connection, i, cons) {
                 if (irc_connection) {
-                    irc_connection.end('QUIT :' + (global.config.quit_message || ''));
+                    irc_connection.end('QUIT :' + (irc_connection.quit_message || global.config.quit_message || ''));
                     global.servers.removeConnection(irc_connection);
                     cons[i] = null;
                 }