1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add invite event to irc node

This commit is contained in:
Dave C-J 2014-01-03 10:57:49 +00:00
parent e5536b848a
commit b652d26b6b

View File

@ -60,11 +60,17 @@ function IrcInNode(n) {
var msg = { "topic":from, "from":from, "to":"PRIV", "payload":message }; var msg = { "topic":from, "from":from, "to":"PRIV", "payload":message };
node.send([msg,null]); node.send([msg,null]);
}); });
this.ircclient.addListener('join', function(channel, who) { this.ircclient.addListener('join', function(channel, who) {
var msg = { "payload": { "type":"join", "who":who, "channel":channel } }; var msg = { "payload": { "type":"join", "who":who, "channel":channel } };
node.send([null,msg]); node.send([null,msg]);
node.log(who+' has joined '+channel); node.log(who+' has joined '+channel);
}); });
this.ircclient.addListener('invite', function(channel, from, message) {
var msg = { "payload": { "type":"invite", "who":from, "channel":channel, "message":message } };
node.send([null,msg]);
node.log(from+' sent invite to '+channel+': '+message);
});
this.ircclient.addListener('part', function(channel, who, reason) { this.ircclient.addListener('part', function(channel, who, reason) {
var msg = { "payload": { "type":"part", "who":who, "channel":channel, "reason":reason } }; var msg = { "payload": { "type":"part", "who":who, "channel":channel, "reason":reason } };
node.send([null,msg]); node.send([null,msg]);