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) {
|
var UrlPlugin = function(name, urlCallback) {
|
||||||
return {
|
return {
|
||||||
contentForMessage: function(message) {
|
contentForMessage: function(message) {
|
||||||
var urls = message.match(urlRegexp);
|
var urls = _.uniq(message.match(urlRegexp));
|
||||||
var content = [];
|
var content = [];
|
||||||
|
|
||||||
for (var i = 0; urls && i < urls.length; i++) {
|
for (var i = 0; urls && i < urls.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue