only do notify host lookup on given channels in the config

This commit is contained in:
reality 2014-01-06 18:05:44 +00:00
parent 502d9c5ae8
commit 36aab19204
2 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,7 @@ var commands = function(dbot) {
if(this.config.firstHost) { if(this.config.firstHost) {
var first = message.split(' ')[0]; var first = message.split(' ')[0];
dbot.api.users.resolveUser(event.server, first, function(user) { dbot.api.users.resolveUser(event.server, first, function(user) {
if(user) { if(user && _.include(this.config.host_lookup, channelName)) {
dbot.api.nickserv.getUserHost(event.server, first, function(host) { dbot.api.nickserv.getUserHost(event.server, first, function(host) {
message = message.replace(first, first + ' [' + host + ']'); message = message.replace(first, first + ' [' + host + ']');
this.api.notify('notify', event.server, event.rUser, channelName, message); this.api.notify('notify', event.server, event.rUser, channelName, message);

View File

@ -20,5 +20,8 @@
"chan_redirs": { "chan_redirs": {
"#chan": "#chan-notify" "#chan": "#chan-notify"
}, },
"host_lookup": [
"#chan"
],
"noMissingChans": [] "noMissingChans": []
} }