From a381bf5e433a2acc9717fc456417e198e518b25e Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 22 Dec 2015 11:36:19 -0200 Subject: [PATCH] proper fix preview images --- .../client/messageAttachment.coffee | 7 ------- .../client/messageAttachment.html | 2 +- packages/rocketchat-oembed/client/oembedImageWidget.html | 2 +- packages/rocketchat-oembed/client/oembedUrlWidget.coffee | 7 ------- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.coffee b/packages/rocketchat-message-attachments/client/messageAttachment.coffee index dc04117aabcd..a224b9a872fc 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.coffee +++ b/packages/rocketchat-message-attachments/client/messageAttachment.coffee @@ -1,12 +1,5 @@ Template.messageAttachment.helpers fixCordova: (url) -> - slash = url.lastIndexOf('/') + 1 - - fileName = url.substr slash - filePath = url.substr 0, slash - - url = filePath + encodeURIComponent fileName - if Meteor.isCordova and url?[0] is '/' return Meteor.absoluteUrl().replace(/\/$/, '') + url return url diff --git a/packages/rocketchat-message-attachments/client/messageAttachment.html b/packages/rocketchat-message-attachments/client/messageAttachment.html index 0d9f71b0ce42..dc02f0c03c96 100644 --- a/packages/rocketchat-message-attachments/client/messageAttachment.html +++ b/packages/rocketchat-message-attachments/client/messageAttachment.html @@ -49,7 +49,7 @@
{{#if showImage}} -
+
diff --git a/packages/rocketchat-oembed/client/oembedImageWidget.html b/packages/rocketchat-oembed/client/oembedImageWidget.html index d17ed9ff03a3..144dd7665215 100644 --- a/packages/rocketchat-oembed/client/oembedImageWidget.html +++ b/packages/rocketchat-oembed/client/oembedImageWidget.html @@ -3,7 +3,7 @@ {{#if parsedUrl}}
-
+
diff --git a/packages/rocketchat-oembed/client/oembedUrlWidget.coffee b/packages/rocketchat-oembed/client/oembedUrlWidget.coffee index d3b1f1093a44..79e6127073a6 100644 --- a/packages/rocketchat-oembed/client/oembedUrlWidget.coffee +++ b/packages/rocketchat-oembed/client/oembedUrlWidget.coffee @@ -28,13 +28,6 @@ Template.oembedUrlWidget.helpers decodedOgImage = @meta.ogImage?.replace?(/&/g, '&') - slash = decodedOgImage.lastIndexOf('/') + 1 - - fileName = decodedOgImage.substr slash - filePath = decodedOgImage.substr 0, slash - - decodedOgImage = filePath + encodeURIComponent fileName - return decodedOgImage or this.meta.twitterImage show: ->