Skip to content
Snippets Groups Projects
Unverified Commit 62e06fff authored by Gabriel Engel's avatar Gabriel Engel
Browse files

Fix to prevent stop hubot initiating even when disabled

parent 8bf51153
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ const pkgdef :Spk.PackageDefinition = ( ...@@ -19,7 +19,7 @@ const pkgdef :Spk.PackageDefinition = (
appTitle = (defaultText = "Rocket.Chat"), appTitle = (defaultText = "Rocket.Chat"),
appVersion = 50, # Increment this for every release. appVersion = 51, # Increment this for every release.
appMarketingVersion = (defaultText = "0.50.0-develop"), appMarketingVersion = (defaultText = "0.50.0-develop"),
# Human-readable representation of appVersion. Should match the way you # Human-readable representation of appVersion. Should match the way you
......
...@@ -189,19 +189,19 @@ sendHelper = Meteor.bindEnvironment (robot, envelope, strings, map) -> ...@@ -189,19 +189,19 @@ sendHelper = Meteor.bindEnvironment (robot, envelope, strings, map) ->
InternalHubot = {} InternalHubot = {}
init = => init = =>
InternalHubot = new Robot null, null, false, RocketChat.settings.get 'InternalHubot_Username'
InternalHubot.alias = 'bot'
InternalHubot.adapter = new RocketChatAdapter InternalHubot
HubotScripts(InternalHubot)
InternalHubot.run()
if RocketChat.settings.get 'InternalHubot_Enabled' if RocketChat.settings.get 'InternalHubot_Enabled'
InternalHubot = new Robot null, null, false, RocketChat.settings.get 'InternalHubot_Username'
InternalHubot.alias = 'bot'
InternalHubot.adapter = new RocketChatAdapter InternalHubot
HubotScripts(InternalHubot)
InternalHubot.run()
RocketChat.callbacks.add 'afterSaveMessage', InternalHubotReceiver, RocketChat.callbacks.priority.LOW, 'InternalHubot' RocketChat.callbacks.add 'afterSaveMessage', InternalHubotReceiver, RocketChat.callbacks.priority.LOW, 'InternalHubot'
else else
InternalHubot = {}
RocketChat.callbacks.remove 'afterSaveMessage', 'InternalHubot' RocketChat.callbacks.remove 'afterSaveMessage', 'InternalHubot'
Meteor.startup -> Meteor.startup ->
init() init()
RocketChat.models.Settings.findByIds([ 'InternalHubot_Username', 'InternalHubot_Enabled', 'InternalHubot_ScriptsToLoad']).observe RocketChat.models.Settings.findByIds([ 'InternalHubot_Username', 'InternalHubot_Enabled', 'InternalHubot_ScriptsToLoad']).observe
changed: -> changed: ->
init() _.debounce init(), 1000
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