Plugins: don't show plugin repeatedly for same URL in same message

Fixes #636
This commit is contained in:
Lorenz Hübschle-Schneider 2016-11-01 11:08:40 +01:00
parent 03af5d7158
commit ec221af52e
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ var urlRegexp = /(?:(?:https?|ftp):\/\/|www\.|ftp\.)\S*[^\s.;,(){}<>]/g;
var UrlPlugin = function(name, urlCallback) {
return {
contentForMessage: function(message) {
var urls = message.match(urlRegexp);
var urls = _.uniq(message.match(urlRegexp));
var content = [];
for (var i = 0; urls && i < urls.length; i++) {