From efc76788011da4d2216e215237289cf9d0913179 Mon Sep 17 00:00:00 2001 From: xandy Date: Sun, 6 Jan 2013 17:37:25 +0100 Subject: [PATCH] add names#channel event --- docs/API.rst | 6 ++++++ lib/irc.js | 1 + package.json | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/API.rst b/docs/API.rst index 296c6cba..c762a405 100644 --- a/docs/API.rst +++ b/docs/API.rst @@ -188,6 +188,12 @@ Events callback is keyed by nick names, and has values '', '+', or '@' depending on the level of that nick in the channel. +.. js:data:: 'names#channel' + + `function (nicks) { }` + + As per 'names' event but only emits for the subscribed channel. + .. js:data:: 'topic' `function (channel, topic, nick, message) { }` diff --git a/lib/irc.js b/lib/irc.js index c8428091..08de1f89 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -317,6 +317,7 @@ function Client(server, nick, opt) { var channel = self.chanData(message.args[1]); if ( channel ) { self.emit('names', message.args[1], channel.users); + self.emit('names' + message.args[1], channel.users); self.send('MODE', message.args[1]); } break; diff --git a/package.json b/package.json index 6704504a..ed9408cf 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "description" : "An IRC client library for node", "version" : "0.3.5", "author" : "Martyn Smith ", - "contributors" : [], + "contributors" : [ { + "name": "xAndy", + "email": "xandy@hackerspace-bamberg.de" + } ], "repository" : { "type" : "git", "url" : "http://github.com/martynsmith/node-irc"