Added 'prefetch' option
This commit is contained in:
parent
66352d6519
commit
681d3dac1a
@ -209,6 +209,7 @@
|
||||
Enable colored nicknames
|
||||
</label>
|
||||
</div>
|
||||
<% if (typeof prefetch === "undefined" || prefetch !== false) { %>
|
||||
<div class="col-sm-12">
|
||||
<h2>Links and URLs</h2>
|
||||
</div>
|
||||
@ -224,6 +225,7 @@
|
||||
Auto-expand links
|
||||
</label>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="col-sm-12">
|
||||
<h2>Notifications</h2>
|
||||
</div>
|
||||
|
11
config.js
11
config.js
@ -45,6 +45,17 @@ module.exports = {
|
||||
//
|
||||
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
|
||||
//
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user