mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 04:23:13 +00:00
Added 'prefetch' option
This commit is contained in:
parent
66352d6519
commit
681d3dac1a
3 changed files with 19 additions and 0 deletions
|
@ -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
|
@ -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
|
||||
|
|
|
@ -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 a new issue