Skip to content

Commit

Permalink
Updates message-handlers for team_xxx events to write the team back…
Browse files Browse the repository at this point in the history
… to the data-store
  • Loading branch information
l12s committed Feb 16, 2016
1 parent 1d9bc3f commit c700d70
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v2.0.2 (2016-02-15)

* Adds coveralls to the repo, to track code coverage and display a badge in the README
* Updates the disconnect function on the RTM client to support both an error message and a code or reason for the disconnect, e.g. `account_inactive`
* Updates the message-handlers for `team_xxx` events to set the team back to the data-store once changes are made

### v2.0.1 (2016-02-13)

* Updates to `ws@1.0.1`
Expand Down
3 changes: 3 additions & 0 deletions lib/data-store/message-handlers/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ var handleTeamDomainChange = function handleTeamDomainChange(
var team = dataStore.getTeamById(activeTeamId);
team.domain = message.domain;
team.url = message.url;
dataStore.setTeam(team);
};


/** {@link https://api.slack.com/events/team_rename|team_rename} */
var handleTeamRename = function handleTeamRename(activeUserId, activeTeamId, dataStore, message) {
var team = dataStore.getTeamById(activeTeamId);
team.name = message.name;
dataStore.setTeam(team);
};


Expand All @@ -29,6 +31,7 @@ var handleTeamPrefChange = function handleTeamPrefChange(
activeUserId, activeTeamId, dataStore, message) {
var team = dataStore.getTeamById(activeTeamId);
team.prefs[message.name] = message.value;
dataStore.setTeam(team);
};


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slack-client",
"version": "2.0.1",
"version": "2.0.2",
"description": "A library for creating a Slack client",
"main": "./index",
"scripts": {
Expand Down

0 comments on commit c700d70

Please sign in to comment.