Enable link fetcher

This commit is contained in:
Pavel Djundik 2016-03-08 12:31:43 +02:00 committed by Maxime Poulin
parent 356851c3f2
commit 82e192cd2c

View File

@ -9,7 +9,7 @@ process.setMaxListeners(0);
module.exports = function(irc, network) {
var client = this;
irc.on("message", function(data) {
irc.on("privmsg", function(data) {
var config = Helper.getConfig();
if (!config.prefetch) {
return;
@ -27,8 +27,7 @@ module.exports = function(irc, network) {
return;
}
var self = data.to.toLowerCase() === irc.user.nick.toLowerCase();
var chan = _.find(network.channels, {name: self ? data.from : data.to});
var chan = _.find(network.channels, {name: data.target});
if (typeof chan === "undefined") {
return;
}