diff --git a/client/index.html b/client/index.html index 7790e62..ab388f5 100644 --- a/client/index.html +++ b/client/index.html @@ -209,6 +209,7 @@ Enable colored nicknames + <% if (typeof prefetch === "undefined" || prefetch !== false) { %>

Links and URLs

@@ -224,6 +225,7 @@ Auto-expand links + <% } %>

Notifications

diff --git a/config.js b/config.js index 4e41abb..4f1abb4 100644 --- a/config.js +++ b/config.js @@ -44,6 +44,17 @@ module.exports = { // @default true // autoload: true, + + // + // Prefetch URLs + // + // If enabled, Shout will try to load thumbnails and site descriptions from + // URLs posted in channels. + // + // @type boolean + // @default true + // + prefetch: true, // // Log settings diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 282c128..8540281 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -2,10 +2,16 @@ var _ = require("lodash"); var cheerio = require("cheerio"); var Msg = require("../../models/msg"); var request = require("superagent"); +var Helper = require("../../helper"); module.exports = function(irc, network) { var client = this; irc.on("message", function(data) { + var config = Helper.getConfig(); + if (!config.prefetch) { + return; + } + var links = []; var split = data.message.split(" "); _.each(split, function(w) {