From 81198d7ec2813c401b30c88ec6ac5c73bf8c5f6c Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 28 Feb 2014 22:48:59 +0000 Subject: [PATCH] Optional param[0] in PART message --- server/irc/commands.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/irc/commands.js b/server/irc/commands.js index a23b806..5e02c75 100644 --- a/server/irc/commands.js +++ b/server/irc/commands.js @@ -455,17 +455,25 @@ handlers = { }, 'PART': function (command) { - var time; + var time, channel, message; // Check if we have a server-time time = getServerTime.call(this, command); + // Some IRCds (Note: Nefarious) send the channel as the trailing param + if (!command.params[0]) { + channel = command.trailing; + } else { + channel = command.params[0]; + message = command.trailing; + } + this.irc_connection.emit('channel ' + command.params[0] + ' part', { nick: command.nick, ident: command.ident, hostname: command.hostname, - channel: command.params[0], - message: command.trailing, + channel: channel, + message: message, time: time }); }, -- 2.25.1