Skip to content
Snippets Groups Projects
Commit abf9acca authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Settings: API_Embed; closes #225

parent 69d2758e
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,7 @@ Template.message.onViewRendered = (context) ->
ul = lastNode.parentElement
wrapper = ul.parentElement
if context.urls?.length > 0 and Template.oembedBaseWidget?
if context.urls?.length > 0 and Template.oembedBaseWidget? and RocketChat.settings.get 'API_Embed'
for item in context.urls
do (item) ->
urlNode = lastNode.querySelector('.body a[href="'+item.url+'"]')
......
......@@ -61,7 +61,7 @@ Template.message.onViewRendered = (context) ->
ul = lastNode.parentElement
wrapper = ul.parentElement
if context.urls?.length > 0 and Template.oembedBaseWidget?
if context.urls?.length > 0 and Template.oembedBaseWidget? and RocketChat.settings.get 'API_Embed'
for item in context.urls
do (item) ->
urlNode = lastNode.querySelector('.body a[href="'+item.url+'"]')
......
......@@ -170,4 +170,5 @@ OEmbed.RocketUrlParser = (message) ->
return message
RocketChat.callbacks.add 'afterSaveMessage', OEmbed.RocketUrlParser, RocketChat.callbacks.priority.LOW
if RocketChat.settings.get 'API_Embed'
RocketChat.callbacks.add 'afterSaveMessage', OEmbed.RocketUrlParser, RocketChat.callbacks.priority.LOW
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment