From df6d68a57c63ffd0ef16eb2e85bc5ed03e2503c8 Mon Sep 17 00:00:00 2001 From: Darren Date: Mon, 28 Jan 2013 21:19:55 +0000 Subject: [PATCH] Use 1 IrcUser object to handle user events --- server/irc/channel.js | 6 ++++-- server/irc/connection.js | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/irc/channel.js b/server/irc/channel.js index 16400f3..72397af 100644 --- a/server/irc/channel.js +++ b/server/irc/channel.js @@ -141,7 +141,8 @@ function onNicklist(event) { users: event.users, channel: this.name }); - updateUsersList.call(this, event.users); + // TODO: uncomment when using an IrcUser per nick + //updateUsersList.call(this, event.users); }; @@ -150,7 +151,8 @@ function onNicklistEnd(event) { users: event.users, channel: this.name }); - updateUsersList.call(this, event.users); + // TODO: uncomment when using an IrcUser per nick + //updateUsersList.call(this, event.users); }; function updateUsersList(users) { diff --git a/server/irc/connection.js b/server/irc/connection.js index 692e472..a61e2c4 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -79,7 +79,9 @@ IrcConnection.prototype.applyIrcEvents = function () { this.irc_events = { 'server:*:connect': onServerConnect, 'channel:*:join': onChannelJoin, - 'user:*:privmsg': onUserPrivmsg, + + // TODO: uncomment when using an IrcUser per nick + //'user:*:privmsg': onUserPrivmsg, 'channel:*:part': onUserParts, 'channel:*:quit': onUserParts, 'channel:*:kick': onUserParts @@ -227,7 +229,9 @@ function onChannelJoin(event) { function onServerConnect(event) { this.nick = event.nick; - this.irc_users[event.nick] = new IrcUser(this, event.nick); + + // TODO: use `event.nick` instead of `'*'` when using an IrcUser per nick + this.irc_users[event.nick] = new IrcUser(this, '*'); } -- 2.25.1