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

use RocketBot_Enabled settings

parent 1e8bd4f3
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ rocketchat:slashcommands-leave
rocketchat:statistics
rocketchat:webrtc
#rocketchat:livechat
rocketchat:hubot
#rocketchat:hubot
#rocketchat:irc
konecty:change-case
......
......@@ -110,7 +110,6 @@ rocketchat:favico@0.0.1
rocketchat:file@0.0.1
rocketchat:gitlab@0.0.1
rocketchat:highlight@0.0.1
rocketchat:hubot@0.0.1
rocketchat:ldap@0.0.1
rocketchat:lib@0.0.1
rocketchat:logger@0.0.1
......
......@@ -284,7 +284,10 @@ init = =>
# RocketBot.hear /^test/i, (res) ->
# res.send "Test? TESTING? WE DON'T NEED NO TEST, EVERYTHING WORKS!"
RocketChat.callbacks.add 'afterSaveMessage', RocketBotReceiver, RocketChat.callbacks.priority.LOW
if RocketChat.settings.get 'RocketBot_Enabled'
RocketChat.callbacks.add 'afterSaveMessage', RocketBotReceiver, RocketChat.callbacks.priority.LOW, 'rocketbot-parser'
else
RocketChat.callbacks.remove 'afterSaveMessage', 'rocketbot-parser'
# Meteor.startup ->
# console.log RocketBot;
......@@ -332,8 +335,10 @@ init = =>
# username: "rocketbot"
# action: true
RocketChat.models.Settings.find({ _id: 'RocketBot_Name' }).observe
added: (record) ->
RocketChat.models.Settings.find({ _id: { $in: [ 'RocketBot_Name', 'RocketBot_Enabled'] } }).observe
added: ->
init()
changed: (record) ->
changed: ->
init()
removed: ->
init()
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