Skip to content

Commit

Permalink
Merge pull request #420 from chapmanc/master
Browse files Browse the repository at this point in the history
We decided that there wasn't a great way to add tests, so overriding the required coverage status check.
  • Loading branch information
aoberoi authored Aug 21, 2017
2 parents e76cf7f + 5a1753a commit ea6ed1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/bot.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class SlackBot extends Adapter
constructor: (@robot, @options) ->
@client = new SlackClient(@options, @robot)

###
Slackbot loads full user list on the first brain load
QUESTION: why do brain adapters trigger a brain 'loaded' event each time a key
is set?
###
setIsLoaded: (@isLoaded) ->

###
Slackbot initialization
Expand All @@ -55,8 +61,12 @@ class SlackBot extends Adapter
@client.on 'user_change', @userChange

@client.web.users.list @loadUsers

@robot.brain.on 'loaded', () =>
@client.web.users.list @loadUsers
if not @isLoaded
@client.web.users.list @loadUsers
this.setIsLoaded(true)


# Start logging in
@client.connect()
Expand Down
1 change: 1 addition & 0 deletions src/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class SlackClient
Open connection to the Slack RTM API
###
connect: ->
# QUESTION: why do we throw away the login data?
@rtm.login()


Expand Down

0 comments on commit ea6ed1f

Please sign in to comment.