//front.tabviews[destination.toLowerCase()].addMsg(null, ' ', '* '+data.nick+' '+data.msg, 'color:green;');
front.cur_channel.addMsg(null, ' ', '* ' + gateway.nick + ' ' + msg.substring(4), 'action', 'color:#555;');
break;
+
+ case '/notice':
+ var dest, msg;
+ dest = parts[1];
+ msg = parts.slice(2).join(' ');
+
+ gateway.notice(dest, msg);
+ this.onNotice({}, {nick:gateway.nick, channel:dest, msg:msg});
+ break;
+
case '/quit':
gateway.quit(msg.split(" ",2)[1]);
break;
},
+ notice: function (s_target, s_msg, callback) {
+ var data = {
+ method: 'notice',
+ args: {
+ target: s_target,
+ msg: s_msg
+ }
+ };
+
+ gateway.sendData(data, callback);
+ },
+
+
join: function (s_channel, callback) {
var data = {
method: 'join',
//setup websocket listener
if (config.listen_ssl) {
- var io = ws.listen(config.port, {secure: true, key: fs.readFileSync(__dirname + '/' + config.ssl_key), cert: fs.readFileSync(__dirname + '/' + config.ssl_cert)});
+ var io = ws.listen('127.0.0.1:'+config.port.toString(), {secure: true, key: fs.readFileSync(__dirname + '/' + config.ssl_key), cert: fs.readFileSync(__dirname + '/' + config.ssl_cert)});
} else {
- var io = ws.listen(config.port, {secure: false});
+ var io = ws.listen('127.0.0.1:'+config.port.toString(), {secure: false});
}
io.sockets.on('connection', function (websocket) {
websocket.on('irc connect', function (nick, host, port, ssl, callback) {
websocket.ircSocket.destroySoon();
websocket.disconnect();
break;
+ case 'notice':
+ if ((args.target) && (args.msg)) {
+ websocket.ircSocket.write('NOTICE ' + args.target + ' :' + args.msg + '\r\n');
+ }
+ break;
default:
}
if ((callback) && (typeof (callback) === 'function')) {