Plugins: don't show plugin repeatedly for same URL in same message
Fixes #636
This commit is contained in:
parent
03af5d7158
commit
ec221af52e
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue