Skip to content

Commit

Permalink
Merge pull request #7208 from RocketChat/fix-oembed-previews-not-showing
Browse files Browse the repository at this point in the history
[FIX] Fix oembed previews not being shown
  • Loading branch information
sampaiodiego committed Jun 12, 2017
1 parent c5ffd45 commit c5723da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/rocketchat-ui-message/client/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,13 @@ Template.message.helpers({
}
},
hasOembed() {
if (!(this.urls && this.urls.length > 0 && Template.oembedBaseWidget != null && RocketChat.settings.get('API_Embed'))) {
// there is no URLs, there is no template to show the oembed (oembed package removed) or oembed is not enable
if (!(this.urls && this.urls.length > 0) || !Template.oembedBaseWidget || !RocketChat.settings.get('API_Embed')) {
return false;
}
if (!(RocketChat.settings.get('API_EmbedDisabledFor')||'').split(',').map(username => username.trim()).includes(this.u && this.u.username)) {

// check if oembed is disabled for message's sender
if ((RocketChat.settings.get('API_EmbedDisabledFor')||'').split(',').map(username => username.trim()).includes(this.u && this.u.username)) {
return false;
}
return true;
Expand Down

0 comments on commit c5723da

Please sign in to comment.