diff --git a/js/plugins.js b/js/plugins.js index c1ad7f4..1880d3e 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -150,16 +150,24 @@ plugins.factory('userPlugins', function() { * Image Preview */ var imagePlugin = new Plugin(function(message) { - - var url = message.match(urlRegexp); - if (url) { - var url = url[0]; /* Actually parse one url per message */ + var url = message.match(urlRegexp); + var content = null; + + if (url) { + var url = url[0]; /* Actually parse one url per message */ if (url.match(/png$|gif$|jpg$|jpeg$/)) { - return ''; - } + + /* A fukung.net URL may end by an image extension but is not a direct link. */ + if (url.indexOf("fukung.net/v/") != -1) { + url = url.replace(/.*\//, "http://media.fukung.net/imgs/") + } + + content = ''; + } } - return null; + + return content; }); imagePlugin.name = 'image';