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