Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement stars and removed stars #27

Merged
merged 3 commits into from
Feb 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,16 @@ class Client extends EventEmitter

unreads

#
# Stars handler callbacks and dispatches
#

onStarAdded: (data) ->
@emit 'star_added', data

onStarRemoved: (data) ->
@emit 'star_removed', data

#
# Message handler callback and dispatch
#
Expand Down Expand Up @@ -461,6 +471,12 @@ class Client extends EventEmitter
when "bot_removed"
if @bots[message.bot.id] then @emit 'botRemoved', @bots[message.bot.id]

when 'star_added'
@emit 'star_added', message

when 'star_removed'
@emit 'star_removed', message

else
if message.reply_to
if message.type == 'pong'
Expand Down