var IrcUser = function (irc_connection, nick) {\r
this.irc_connection = irc_connection;\r
this.nick = nick;\r
- \r
+\r
this.irc_events = {\r
nick: onNick,\r
away: onAway,\r
quit: onQuit,\r
whoisuser: onWhoisUser,\r
+ whoisaway: onWhoisAway,\r
whoisoperator: onWhoisOperator,\r
whoischannels: onWhoisChannels,\r
whoismodes: onWhoisModes,\r
whoisidle: onWhoisIdle,\r
whoisregnick: onWhoisRegNick,\r
+ whoisserver: onWhoisServer,\r
endofwhois: onWhoisEnd,\r
+ whowas: onWhoWas,\r
+ endofwhowas: onWhoWasEnd,\r
+ wasnosuchnick: onWasNoSuchNick,\r
notice: onNotice,\r
ctcp_response: onCtcpResponse,\r
privmsg: onPrivmsg,\r
ctcp_request: onCtcpRequest,\r
mode: onMode\r
};\r
- EventBinder.bindIrcEvents('user:' + this.nick, this.irc_events, this, irc_connection);\r
+ EventBinder.bindIrcEvents('user ' + this.nick, this.irc_events, this, irc_connection);\r
};\r
\r
\r
\r
\r
IrcUser.prototype.dispose = function () {\r
- EventBinder.unbindIrcEvents('user:' + this.nick, this.irc_events, this.irc_connection);\r
+ EventBinder.unbindIrcEvents('user ' + this.nick, this.irc_events, this.irc_connection);\r
this.irc_connection = undefined;\r
};\r
\r
});\r
\r
// TODO: uncomment when using an IrcUser per nick\r
- //EventBinder.unbindIrcEvents('user:' + this.nick, this.irc_events, irc_connection);\r
+ //EventBinder.unbindIrcEvents('user ' + this.nick, this.irc_events, irc_connection);\r
//this.nick = event.newnick;\r
- //EventBinder.bindIrcEvents('user:' + this.nick, this.irc_events, this, irc_connection);\r
-};\r
+ //EventBinder.bindIrcEvents('user ' + this.nick, this.irc_events, this, irc_connection);\r
+}\r
\r
function onAway(event) {\r
this.irc_connection.clientEvent('away', {\r
nick: event.nick,\r
msg: event.msg\r
});\r
-};\r
+}\r
\r
function onQuit(event) {\r
this.irc_connection.clientEvent('quit', {\r
hostname: event.hostname,\r
message: event.trailing\r
});\r
-};\r
+}\r
\r
function onWhoisUser(event) {\r
this.irc_connection.clientEvent('whois', {\r
msg: event.msg,\r
end: false\r
});\r
-};\r
+}\r
+\r
+function onWhoisAway(event) {\r
+ this.irc_connection.clientEvent('whois', {\r
+ nick: event.nick,\r
+ away_reason: event.reason,\r
+ end: false\r
+ });\r
+}\r
\r
function onWhoisServer(event) {\r
this.irc_connection.clientEvent('whois', {\r
nick: event.nick,\r
irc_server: event.irc_server,\r
+ server_info: event.server_info,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisOperator(event) {\r
this.irc_connection.clientEvent('whois', {\r
msg: event.msg,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisChannels(event) {\r
this.irc_connection.clientEvent('whois', {\r
chans: event.chans,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisModes(event) {\r
this.irc_connection.clientEvent('whois', {\r
msg: event.msg,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisIdle(event) {\r
this.irc_connection.clientEvent('whois', {\r
logon: event.logon || undefined,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisRegNick(event) {\r
this.irc_connection.clientEvent('whois', {\r
msg: event.msg,\r
end: false\r
});\r
-};\r
+}\r
\r
function onWhoisEnd(event) {\r
this.irc_connection.clientEvent('whois', {\r
msg: event.msg,\r
end: true\r
});\r
-};\r
+}\r
+\r
+function onWhoWas(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ ident: event.user,\r
+ host: event.host,\r
+ real_name: event.real_name,\r
+ end: false\r
+ });\r
+}\r
+\r
+function onWasNoSuchNick(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ end: false\r
+ });\r
+}\r
+\r
+function onWhoWasEnd(event) {\r
+ this.irc_connection.clientEvent('whowas', {\r
+ nick: event.nick,\r
+ end: true\r
+ });\r
+}\r
\r
function onNotice(event) {\r
this.irc_connection.clientEvent('notice', {\r
+ from_server: event.from_server,\r
nick: event.nick,\r
ident: event.ident,\r
hostname: event.hostname,\r
target: event.target,\r
msg: event.msg\r
});\r
-};\r
+}\r
\r
function onCtcpResponse(event) {\r
this.irc_connection.clientEvent('ctcp_response', {\r
channel: event.channel,\r
msg: event.msg\r
});\r
-};\r
+}\r
\r
function onPrivmsg(event) {\r
this.irc_connection.clientEvent('msg', {\r
channel: event.channel,\r
msg: event.msg\r
});\r
-};\r
+}\r
\r
function onCtcpRequest(event) {\r
this.irc_connection.clientEvent('ctcp_request', {\r
type: event.type,\r
msg: event.msg\r
});\r
-};\r
+}\r
\r
function onMode(event) {\r
this.irc_connection.clientEvent('mode', {\r
nick: event.nick,\r
modes: event.modes\r
});\r
-};\r
+}\r