-function IrcChannel(irc_connection, name) {
- var that = this;
-
- this.irc_connection = irc_connection;
- this.name = name;
-
- // Helper for binding listeners
- function bindEvent(event, fn) {
- irc_connection.on('channel:' + name + ':' + event, function () {
- fn.apply(that, arguments);
- });
- }
-
- bindEvent('join', this.onJoin);
- bindEvent('part', this.onPart);
- bindEvent('kick', this.onKick);
- bindEvent('quit', this.onQuit);
-
- bindEvent('privmsg', this.onMsg);
- bindEvent('notice', this.onNotice);
- bindEvent('ctcp_request', this.onCtcpRequest);
- bindEvent('ctcp_response', this.onCtcpResponse);