body, html {\r
- height: 100%; margin:0px;\r
- font-size:14px;\r
- line-height:1.4em;\r
+ height: 100%; margin:0px;\r
+ font-size:14px;\r
+ line-height:1.4em;\r
}\r
\r
\r
\r
/* Style resets */\r
#kiwi * {\r
- padding:0px; margin:0px;\r
+ padding:0px; margin:0px;\r
}\r
#kiwi ul { list-style:none; }\r
\r
#kiwi a {\r
- color: #36C; text-decoration:none;\r
- cursor: pointer;\r
+ color: #36C; text-decoration:none;\r
+ cursor: pointer;\r
}\r
#kiwi #login a {\r
- color: #8D9713;\r
- text-decoration:none;\r
+ color: #8D9713;\r
+ text-decoration:none;\r
}\r
\r
\r
\r
/* The main app container */\r
#kiwi {\r
- overflow:hidden; position:relative; \r
- height:100%;\r
- font-family:Arial, Helvetica, sans-serif; font-size:1em;\r
- background:#EBEBEB;\r
+ overflow:hidden; position:relative; \r
+ height:100%;\r
+ font-family:Arial, Helvetica, sans-serif; font-size:1em;\r
+ background:#EBEBEB;\r
}\r
#kiwi .messages { font-family:monospace; }\r
#kiwi.small_kiwi .userlist { right:-100px; }\r
\r
\r
#kiwi .windowlist, #kiwi .utilityviewlist {\r
- /*height: 65px;*/\r
- background-color:#1B1B1B;\r
- font-size:0.9em;\r
+ /*height: 65px;*/\r
+ background-color:#1B1B1B;\r
+ font-size:0.9em;\r
}\r
#kiwi .windowlist ul, #kiwi .utilityviewlist ul {\r
- overflow: hidden;\r
- margin-right: 50px;\r
- white-space: nowrap;\r
- display:block;\r
- /*height: 35px;*/\r
+ overflow: hidden;\r
+ margin-right: 50px;\r
+ white-space: nowrap;\r
+ display:block;\r
+ /*height: 35px;*/\r
}\r
#kiwi .windowlist ul li, #kiwi .utilityviewlist ul li {\r
- float: left; list-style: inline;\r
- display:inline; position:relative;\r
- padding:5px; margin:3px;\r
- border: 1px solid #333;\r
- background-color: #eee;\r
- \r
- cursor: pointer;\r
-\r
- line-height: 1.4em;\r
- vertical-align: middle;\r
- \r
- border-radius:5px;\r
- -moz-border-radius:5px;\r
- -webkit-border-radius:5px;\r
- -khtml-border-radius:5px;\r
- behavior: url(border-radius.htc);\r
+ float: left; list-style: inline;\r
+ display:inline; position:relative;\r
+ padding:5px; margin:3px;\r
+ border: 1px solid #333;\r
+ background-color: #eee;\r
+ \r
+ cursor: pointer;\r
+\r
+ line-height: 1.4em;\r
+ vertical-align: middle;\r
+ \r
+ border-radius:5px;\r
+ -moz-border-radius:5px;\r
+ -webkit-border-radius:5px;\r
+ -khtml-border-radius:5px;\r
+ behavior: url(border-radius.htc);\r
\r
background-image: -webkit-gradient(\r
linear,\r
}\r
#kiwi .windowlist .active, #kiwi .utilityviewlist .active { padding-right:23px; }\r
#kiwi .windowlist .highlight, #kiwi .utilityviewlist .highlight {\r
- background: #990000;\r
- font-weight: bold;\r
+ background: #990000;\r
+ font-weight: bold;\r
}\r
#kiwi .windowlist .activity, #kiwi .utilityviewlist .activity { font-weight: bold; background: #009900; }\r
\r
#kiwi .windowlist ul li img, #kiwi .utilityviewlist ul li img { width:1em; height:1em; top:7px; right:5px; position:absolute; }\r
#kiwi .windowlist ul li img.icon, #kiwi .utilityviewlist ul li img.icon { left:5px; top:2px; height:auto; width:auto;}\r
/*#kiwi .windowlist ul li a {\r
- margin:3px;\r
- border: 1px solid #333;\r
- background-color: #eee;\r
- display: inline;\r
+ margin:3px;\r
+ border: 1px solid #333;\r
+ background-color: #eee;\r
+ display: inline;\r
}*/\r
\r
#kiwi .poweredby { float:right; margin:8px 15px; cursor:pointer; color:#EBEBEB; font-family: arial;}\r
\r
\r
#kiwi .userlist {\r
- position: absolute;\r
- width: 100px;\r
- top:92px; right:0px;\r
- bottom: 55px;\r
- overflow-y:auto; overflow-x:hidden;\r
+ position: absolute;\r
+ width: 100px;\r
+ top:92px; right:0px;\r
+ bottom: 55px;\r
+ overflow-y:auto; overflow-x:hidden;\r
}\r
#kiwi .userlist ul { display: none; margin:5px; }\r
#kiwi .userlist ul.active { display:block; }\r
#kiwi .userlist ul li .userbox a { display:block; text-decoration:none; border-bottom: 1px dashed #aaa; }\r
\r
#nicklist_resize {\r
- position:absolute; cursor:w-resize; width:5px;\r
- background: url(/img/scroll_handle.png) no-repeat;\r
- background-position: center;\r
+ position:absolute; cursor:w-resize; width:5px;\r
+ background: url(/img/scroll_handle.png) no-repeat;\r
+ background-position: center;\r
}\r
\r
#kiwi .cur_topic {\r
- font-family:Verdana, Geneva, sans-serif;\r
- font-size:.85em;\r
- line-height:18px; vertical-align:middle;\r
- /*height:18px;*/\r
- text-align:center;\r
- /*white-space: nowrap;*/ overflow: hidden;\r
- padding: 3px 5px;\r
- border-bottom:3px solid #1B1B1B;\r
- \r
+ font-family:Verdana, Geneva, sans-serif;\r
+ font-size:.85em;\r
+ line-height:18px; vertical-align:middle;\r
+ /*height:18px;*/\r
+ text-align:center;\r
+ /*white-space: nowrap;*/ overflow: hidden;\r
+ padding: 3px 5px;\r
+ border-bottom:3px solid #1B1B1B;\r
+ \r
}\r
\r
\r
#kiwi_menu {\r
- display:none;\r
- position:absolute;\r
- right:0px;\r
- background: gray;\r
- border: 1px solid dark-gray;\r
+ display:none;\r
+ position:absolute;\r
+ right:0px;\r
+ background: gray;\r
+ border: 1px solid dark-gray;\r
}\r
.cur_topic .edit:hover #kiwi_menu { display:inline; }\r
\r
\r
\r
#kiwi .windows {\r
- position: absolute;\r
- top:92px; left:0px;\r
- right: 110px; bottom:30px;\r
- outline: none;\r
+ position: absolute;\r
+ top:92px; left:0px;\r
+ right: 110px; bottom:30px;\r
+ outline: none;\r
}\r
#kiwi .panel { overflow-y:scroll; height:100%; }\r
#panel1 { float:left; width:100%;}\r
#panel2 { float:right; width:0%; }\r
#kiwi .messages {\r
- overflow-x:wrap;\r
- border:none;\r
- display: none;\r
- height: 100%;\r
+ overflow-x:wrap;\r
+ border:none;\r
+ display: none;\r
+ height: 100%;\r
}\r
#kiwi .messages a {\r
- text-decoration:none;\r
+ text-decoration:none;\r
}\r
#kiwi .messages.active { display:block; }\r
\r
#kiwi .messages .msg.whois .nick { font-weight:normal; }\r
#kiwi .messages .msg.whois .text { margin-left:18em; padding-left:1em; border-left:1px dashed #999; }\r
#kiwi .messages .msg.error .text {\r
- border:1px solid #A33F3F; background-color:#D28A8A;\r
- padding:0.5em; margin-top:1em; margin-bottom:1em; margin-right:2em;\r
+ border:1px solid #A33F3F; background-color:#D28A8A;\r
+ padding:0.5em; margin-top:1em; margin-bottom:1em; margin-right:2em;\r
}\r
\r
\r
*/\r
#kiwi .messages a { position: relative; }\r
#kiwi .messages a .tt {\r
- position: absolute; display:none;\r
- padding: 1em 1.5em;\r
- /*background-image: -webkit-gradient(\r
- linear,\r
- left bottom,\r
- left top,\r
- color-stop(0.04, rgb(164,200,126)),\r
- color-stop(0.52, rgb(197,240,164))\r
- );\r
- background-image: -moz-linear-gradient(\r
- center bottom,\r
- rgb(164,200,126) 4%,\r
- rgb(197,240,164) 52%\r
- );\r
- border: 1px solid #444;\r
- border-radius:5px;\r
- -moz-border-radius:5px;\r
- -webkit-border-radius:5px;*/\r
- font-size: 0.9em;\r
+ position: absolute; display:none;\r
+ padding: 1em 1.5em;\r
+ /*background-image: -webkit-gradient(\r
+ linear,\r
+ left bottom,\r
+ left top,\r
+ color-stop(0.04, rgb(164,200,126)),\r
+ color-stop(0.52, rgb(197,240,164))\r
+ );\r
+ background-image: -moz-linear-gradient(\r
+ center bottom,\r
+ rgb(164,200,126) 4%,\r
+ rgb(197,240,164) 52%\r
+ );\r
+ border: 1px solid #444;\r
+ border-radius:5px;\r
+ -moz-border-radius:5px;\r
+ -webkit-border-radius:5px;*/\r
+ font-size: 0.9em;\r
}\r
#kiwi .messages a:hover .tt { display:inline; cursor:default; }\r
#kiwi .messages a:hover .tt a { cursor:pointer; color:inherit; }\r
\r
\r
#kiwi .control {\r
- position: absolute;\r
- bottom:0px; left: 0px;\r
- /*height:55px;*/\r
- /*padding: 3px;*/\r
- width: 100%;\r
- background-color:#1B1B1B;\r
+ position: absolute;\r
+ bottom:0px; left: 0px;\r
+ /*height:55px;*/\r
+ /*padding: 3px;*/\r
+ width: 100%;\r
+ background-color:#1B1B1B;\r
}\r
#kiwi .control .msginput {\r
- background-color:#fff; margin:3px;\r
- position:relative; height:1.7em;\r
- \r
- border-radius:5px;\r
- -moz-border-radius:5px;\r
- -webkit-border-radius:5px;\r
- -khtml-border-radius:5px;\r
- behavior: url(border-radius.htc);\r
+ background-color:#fff; margin:3px;\r
+ position:relative; height:1.7em;\r
+ \r
+ border-radius:5px;\r
+ -moz-border-radius:5px;\r
+ -webkit-border-radius:5px;\r
+ -khtml-border-radius:5px;\r
+ behavior: url(border-radius.htc);\r
}\r
#kiwi .control .nick { text-align: right; width:11em; position:absolute; padding:2px; }\r
#kiwi .control .nick a { text-decoration:none; }\r
#kiwi .control #kiwi_msginput_wrapper {\r
- border:none;\r
- position:absolute;\r
- right:5px;\r
- left: 12.2em;\r
- /*padding: 2px 0px;*/\r
+ border:none;\r
+ position:absolute;\r
+ right:5px; left: 12.2em;\r
height:1.7em;\r
- outline:none;\r
}\r
#kiwi .control input {\r
- width: 100%;\r
- height: 100%;\r
+ width: 100%; height: 100%;\r
position: relative;\r
border: medium none;\r
+ outline:none;\r
}\r
#kiwi .control .plugins { margin:3px; margin-top:7px; }\r
#kiwi .control .plugins ul li {\r
- display:inline; font-size:0.8em; margin-left:1em;\r
+ display:inline; font-size:0.8em; margin-left:1em;\r
}
\ No newline at end of file
/*jslint sloppy: true, continue: true, forin: true, regexp: true, undef: false, node: true, nomen: true, plusplus: true, maxerr: 50, indent: 4 */
/*globals kiwi_root */
/* Fuck you, git. */
-var tls = null;
-var net = null;
-var http = null;
-var https = null;
-var fs = null;
-var url = null;
-var dns = null;
-var crypto = null;
-var events = require('events');
-var util = require('util');
-var ws = null;
-var jsp = null;
-var pro = null;
-var _ = null;
-var starttls = null;
-var kiwi = null;
+var tls = null,
+ net = null,
+ http = null,
+ https = null,
+ fs = null,
+ url = null,
+ dns = null,
+ crypto = null,
+ events = null,
+ util = null,
+ ws = null,
+ jsp = null,
+ pro = null,
+ _ = null,
+ starttls = null,
+ kiwi = null;
this.init = function (objs) {
tls = objs.tls;
_ = objs._;
starttls = objs.starttls;
kiwi = require('./kiwi.js');
+
+ util.inherits(this.IRCConnection, events.EventEmitter);
};
this.bindIRCCommands = function (irc_connection, websocket) {
- var boundEvents = [];
+ var bound_events = [];
irc_connection.on('irc_PING', function (msg) {
websocket.sendServerLine('PONG ' + msg.trailing);
});
- boundEvents.push('irc_PING');
+ bound_events.push('irc_PING');
irc_connection.on('irc_' + ircNumerics.RPL_WELCOME, function (msg) {
if (irc_connection.IRC.CAP.negotiating) {
var nick = msg.params.split(' ')[0];
websocket.sendClientEvent('connect', {connected: true, host: null, nick: nick});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WELCOME);
+ bound_events.push('irc_' + ircNumerics.RPL_WELCOME);
irc_connection.on('irc_' + ircNumerics.RPL_ISUPPORT, function (msg) {
var opts = msg.params.split(" "),
websocket.sendClientEvent('options', {server: '', "options": irc_connection.IRC.options});
});
- boundEvents.push('irc_' + ircNumerics.RPL_ISUPPORT);
+ bound_events.push('irc_' + ircNumerics.RPL_ISUPPORT);
irc_connection.on('irc_' + ircNumerics.RPL_ENDOFWHOIS, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: true});
});
- boundEvents.push('irc_' + ircNumerics.RPL_ENDOFWHOIS);
+ bound_events.push('irc_' + ircNumerics.RPL_ENDOFWHOIS);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISUSER, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISUSER);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISUSER);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISSERVER, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISSERVER);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISSERVER);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISOPERATOR, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISOPERATOR);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISOPERATOR);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISCHANNELS, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISCHANNELS);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISCHANNELS);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISMODES, function (msg) {
websocket.sendClientEvent('whois', {server: '', nick: msg.params.split(" ", 3)[1], "msg": msg.trailing, end: false});
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISMODES);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISMODES);
irc_connection.on('irc_' + ircNumerics.RPL_LISTSTART, function (msg) {
websocket.sendClientEvent('list_start', {server: ''});
websocket.kiwi.buffer.list = [];
});
- boundEvents.push('irc_' + ircNumerics.RPL_LISTSTART);
+ bound_events.push('irc_' + ircNumerics.RPL_LISTSTART);
irc_connection.on('irc_' + ircNumerics.RPL_LISTEND, function (msg) {
if (websocket.kiwi.buffer.list.length > 0) {
}
websocket.sendClientEvent('list_end', {server: ''});
});
- boundEvents.push('irc_' + ircNumerics.RPL_LISTEND);
+ bound_events.push('irc_' + ircNumerics.RPL_LISTEND);
irc_connection.on('irc_' + ircNumerics.RPL_LIST, function (msg) {
var parts, channel, num_users, topic;
websocket.kiwi.buffer.list = [];
}
});
- boundEvents.push('irc_' + ircNumerics.RPL_LIST);
+ bound_events.push('irc_' + ircNumerics.RPL_LIST);
irc_connection.on('irc_' + ircNumerics.RPL_WHOISIDLE, function (msg) {
var params = msg.params.split(" ", 4),
}
websocket.sendClientEvent('whois', rtn);
});
- boundEvents.push('irc_' + ircNumerics.RPL_WHOISIDLE);
+ bound_events.push('irc_' + ircNumerics.RPL_WHOISIDLE);
irc_connection.on('irc_' + ircNumerics.RPL_MOTD, function (msg) {
websocket.kiwi.buffer.motd += msg.trailing + '\n';
});
- boundEvents.push('irc_' + ircNumerics.RPL_MOTD);
+ bound_events.push('irc_' + ircNumerics.RPL_MOTD);
irc_connection.on('irc_' + ircNumerics.RPL_MOTDSTART, function (msg) {
websocket.kiwi.buffer.motd = '';
});
- boundEvents.push('irc_' + ircNumerics.RPL_MOTDSTART);
+ bound_events.push('irc_' + ircNumerics.RPL_MOTDSTART);
irc_connection.on('irc_' + ircNumerics.RPL_ENDOFMOTD, function (msg) {
websocket.sendClientEvent('motd', {server: '', 'msg': websocket.kiwi.buffer.motd});
});
- boundEvents.push('irc_' + ircNumerics.RPL_ENDOFMOTD);
+ bound_events.push('irc_' + ircNumerics.RPL_ENDOFMOTD);
irc_connection.on('irc_' + ircNumerics.RPL_NAMEREPLY, function (msg) {
var params = msg.params.split(" "),
kiwi.log("oops");
}
});
- boundEvents.push('irc_' + ircNumerics.RPL_NAMEREPLY);
+ bound_events.push('irc_' + ircNumerics.RPL_NAMEREPLY);
irc_connection.on('irc_' + ircNumerics.RPL_ENDOFNAMES, function (msg) {
websocket.sendClientEvent('userlist_end', {server: '', channel: msg.params.split(" ")[1]});
});
- boundEvents.push('irc_' + ircNumerics.RPL_ENDOFNAMES);
+ bound_events.push('irc_' + ircNumerics.RPL_ENDOFNAMES);
irc_connection.on('irc_' + ircNumerics.ERR_LINKCHANNEL, function (msg) {
var params = msg.params.split(" ");
websocket.sendClientEvent('channel_redirect', {from: params[1], to: params[2]});
});
- boundEvents.push('irc_' + ircNumerics.ERR_LINKCHANNEL);
+ bound_events.push('irc_' + ircNumerics.ERR_LINKCHANNEL);
irc_connection.on('irc_' + ircNumerics.ERR_NOSUCHNICK, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'no_such_nick', nick: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_NOSUCHNICK);
+ bound_events.push('irc_' + ircNumerics.ERR_NOSUCHNICK);
irc_connection.on('irc_' + ircNumerics.RPL_BANLIST, function (msg) {
var params = msg.params.split(" ");
kiwi.log(params);
websocket.sendClientEvent('banlist', {server: '', channel: params[1], banned: params[2], banned_by: params[3], banned_at: params[4]});
});
- boundEvents.push('irc_' + ircNumerics.RPL_BANLIST);
+ bound_events.push('irc_' + ircNumerics.RPL_BANLIST);
irc_connection.on('irc_' + ircNumerics.RPL_ENDOFBANLIST, function (msg) {
websocket.sendClientEvent('banlist_end', {server: '', channel: msg.params.split(" ")[1]});
});
- boundEvents.push('irc_' + ircNumerics.RPL_ENDOFBANLIST);
+ bound_events.push('irc_' + ircNumerics.RPL_ENDOFBANLIST);
irc_connection.on('irc_JOIN', function (msg) {
var channel;
websocket.sendServerLine('NAMES ' + msg.trailing);
}
});
- boundEvents.push('irc_JOIN');
+ bound_events.push('irc_JOIN');
irc_connection.on('irc_PART', function (msg) {
websocket.sendClientEvent('part', {nick: msg.nick, ident: msg.ident, hostname: msg.hostname, channel: msg.params.trim(), message: msg.trailing});
});
- boundEvents.push('irc_PART');
+ bound_events.push('irc_PART');
irc_connection.on('irc_KICK', function (msg) {
var params = msg.params.split(" ");
websocket.sendClientEvent('kick', {kicked: params[1], nick: msg.nick, ident: msg.ident, hostname: msg.hostname, channel: params[0].trim(), message: msg.trailing});
});
- boundEvents.push('irc_KICK');
+ bound_events.push('irc_KICK');
irc_connection.on('irc_QUIT', function (msg) {
websocket.sendClientEvent('quit', {nick: msg.nick, ident: msg.ident, hostname: msg.hostname, message: msg.trailing});
});
- boundEvents.push('irc_QUIT');
+ bound_events.push('irc_QUIT');
irc_connection.on('irc_NOTICE', function (msg) {
if ((msg.trailing.charAt(0) === String.fromCharCode(1)) && (msg.trailing.charAt(msg.trailing.length - 1) === String.fromCharCode(1))) {
websocket.sendClientEvent('notice', {nick: msg.nick, ident: msg.ident, hostname: msg.hostname, target: msg.params.trim(), msg: msg.trailing});
}
});
- boundEvents.push('irc_NOTICE');
+ bound_events.push('irc_NOTICE');
irc_connection.on('irc_NICK', function (msg) {
websocket.sendClientEvent('nick', {nick: msg.nick, ident: msg.ident, hostname: msg.hostname, newnick: msg.trailing});
});
- boundEvents.push('irc_NICK');
+ bound_events.push('irc_NICK');
irc_connection.on('irc_TOPIC', function (msg) {
var obj = {nick: msg.nick, channel: msg.params, topic: msg.trailing};
websocket.sendClientEvent('topic', obj);
});
- boundEvents.push('irc_TOPIC');
+ bound_events.push('irc_TOPIC');
irc_connection.on('irc_' + ircNumerics.RPL_TOPIC, function (msg) {
var obj = {nick: '', channel: msg.params.split(" ")[1], topic: msg.trailing};
websocket.sendClientEvent('topic', obj);
});
- boundEvents.push('irc_' + ircNumerics.RPL_TOPIC);
+ bound_events.push('irc_' + ircNumerics.RPL_TOPIC);
irc_connection.on('irc_' + ircNumerics.RPL_NOTOPIC, function (msg) {
var obj = {nick: '', channel: msg.params.split(" ")[1], topic: ''};
websocket.sendClientEvent('topic', obj);
});
- boundEvents.push('irc_' + ircNumerics.RPL_NOTOPIC);
+ bound_events.push('irc_' + ircNumerics.RPL_NOTOPIC);
irc_connection.on('irc_' + ircNumerics.RPL_TOPICWHOTIME, function (msg) {
var parts = msg.params.split(' '),
obj = {nick: nick, channel: channel, when: when};
websocket.sendClientEvent('topicsetby', obj);
});
- boundEvents.push('irc_' + ircNumerics.RPL_TOPICWHOTIME);
+ bound_events.push('irc_' + ircNumerics.RPL_TOPICWHOTIME);
irc_connection.on('irc_MODE', function (msg) {
var opts = msg.params.split(" "),
}
websocket.sendClientEvent('mode', params);
});
- boundEvents.push('irc_MODE');
+ bound_events.push('irc_MODE');
irc_connection.on('irc_PRIVMSG', function (msg) {
var tmp, namespace, obj;
websocket.sendClientEvent('msg', obj);
}
});
- boundEvents.push('irc_PRIVMSG');
+ bound_events.push('irc_PRIVMSG');
irc_connection.on('irc_CAP', function (msg) {
var caps = kiwi.config.cap_options,
break;
}
});
- boundEvents.push('irc_CAP');
+ bound_events.push('irc_CAP');
/*case ircNumerics.RPL_STARTTLS:
try {
IRC = ircSocket.IRC;
irc_connection.on('irc_' + ircNumerics.ERR_CANNOTSENDTOCHAN, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'cannot_send_to_chan', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_CANNOTSENDTOCHAN);
+ bound_events.push('irc_' + ircNumerics.ERR_CANNOTSENDTOCHAN);
irc_connection.on('irc_' + ircNumerics.ERR_TOOMANYCHANNELS, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'too_many_channels', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_TOOMANYCHANNELS);
+ bound_events.push('irc_' + ircNumerics.ERR_TOOMANYCHANNELS);
irc_connection.on('irc_' + ircNumerics.ERR_USERNOTINCHANNEL, function (msg) {
var params = msg.params.split(" ");
websocket.sendClientEvent('irc_error', {error: 'user_not_in_channel', nick: params[0], channel: params[1], reason: msg.trainling});
});
- boundEvents.push('irc_' + ircNumerics.ERR_USERNOTINCHANNEL);
+ bound_events.push('irc_' + ircNumerics.ERR_USERNOTINCHANNEL);
irc_connection.on('irc_' + ircNumerics.ERR_NOTONCHANNEL, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'not_on_channel', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_NOTONCHANNEL);
+ bound_events.push('irc_' + ircNumerics.ERR_NOTONCHANNEL);
irc_connection.on('irc_' + ircNumerics.ERR_CHANNELISFULL, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'channel_is_full', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_CHANNELISFULL);
+ bound_events.push('irc_' + ircNumerics.ERR_CHANNELISFULL);
irc_connection.on('irc_' + ircNumerics.ERR_INVITEONLYCHAN, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'invite_only_channel', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_INVITEONLYCHAN);
+ bound_events.push('irc_' + ircNumerics.ERR_INVITEONLYCHAN);
irc_connection.on('irc_' + ircNumerics.ERR_BANNEDFROMCHAN, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'banned_from_channel', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_BANNEDFROMCHAN);
+ bound_events.push('irc_' + ircNumerics.ERR_BANNEDFROMCHAN);
irc_connection.on('irc_' + ircNumerics.ERR_BADCHANNELKEY, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'bad_channel_key', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_BADCHANNELKEY);
+ bound_events.push('irc_' + ircNumerics.ERR_BADCHANNELKEY);
irc_connection.on('irc_' + ircNumerics.ERR_CHANOPRIVSNEEDED, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'chanop_privs_needed', channel: msg.params.split(" ")[1], reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_CHANOPRIVSNEEDED);
+ bound_events.push('irc_' + ircNumerics.ERR_CHANOPRIVSNEEDED);
irc_connection.on('irc_' + ircNumerics.ERR_NICKNAMEINUSE, function (msg) {
websocket.sendClientEvent('irc_error', {error: 'nickname_in_use', nick: _.last(msg.params.split(" ")), reason: msg.trailing});
});
- boundEvents.push('irc_' + ircNumerics.ERR_NICKNAMEINUSE);
+ bound_events.push('irc_' + ircNumerics.ERR_NICKNAMEINUSE);
irc_connection.on('irc_ERROR', function (msg) {
irc_connection.end();
websocket.sendClientEvent('irc_error', {error: 'error', reason: msg.trailing});
websocket.disconnect();
});
- boundEvents.push('irc_ERROR');
+ bound_events.push('irc_ERROR');
irc_connection.on('irc_' + ircNumerics.ERR_NOTREGISTERED, function (msg) {
if (irc_connection.IRC.registered) {
kiwi.log('Kiwi thinks user is registered, but the IRC server thinks differently');
}
});
- boundEvents.push('irc_' + ircNumerics.ERR_NOTREGISTERED);
+ bound_events.push('irc_' + ircNumerics.ERR_NOTREGISTERED);
- return boundEvents;
+ return bound_events;
};
this.rebindIRCCommands = function () {
that = this,
regex,
onConnectHandler,
- boundEvents;
+ bound_events;
events.EventEmitter.call(this);
ircSocket.destroySoon();
};
- boundEvents = kiwi.bindIRCCommands(this, websocket);
+ bound_events = kiwi.bindIRCCommands(this, websocket);
this.rebindIRCCommands = function () {
- _.each(boundEvents, function (event) {
+ _.each(bound_events, function (event) {
that.removeAllListeners(event);
});
- boundEvents = kiwi.bindIRCCommands(that, websocket);
+ bound_events = kiwi.bindIRCCommands(that, websocket);
};
};
-util.inherits(this.IRCConnection, events.EventEmitter);
-//this.IRCConnection.prototype = events.EventEmitter;
this.websocketMessage = function (websocket, msg, callback) {