Skip to content

Commit

Permalink
observe API embed setting and apply immediatly - fixes #1989
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Feb 29, 2016
1 parent 44c1a1d commit 4487478
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/rocketchat-oembed/server/server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,8 @@ OEmbed.RocketUrlParser = (message) ->

return message

if RocketChat.settings.get 'API_Embed'
RocketChat.callbacks.add 'afterSaveMessage', OEmbed.RocketUrlParser, RocketChat.callbacks.priority.LOW
RocketChat.settings.get 'API_Embed', (key, value) ->
if value
RocketChat.callbacks.add 'afterSaveMessage', OEmbed.RocketUrlParser, RocketChat.callbacks.priority.LOW, 'API_Embed'
else
RocketChat.callbacks.remove 'afterSaveMessage', 'API_Embed'

0 comments on commit 4487478

Please sign in to comment.