Ignore localhost links

This commit is contained in:
Mattias Erming 2015-04-06 10:40:12 -07:00
parent 544c281bf6
commit 29b66ff0ec

View File

@ -16,6 +16,9 @@ module.exports = function(irc, network) {
var links = []; var links = [];
var split = data.message.split(" "); var split = data.message.split(" ");
_.each(split, function(w) { _.each(split, function(w) {
if (w.match(/^(http|https):\/\/localhost/g)) {
return;
}
var match = w.indexOf("http://") === 0 || w.indexOf("https://") === 0; var match = w.indexOf("http://") === 0 || w.indexOf("https://") === 0;
if (match) { if (match) {
links.push(w); links.push(w);