Skip to content

Commit

Permalink
Merge pull request #214 from slackhq/fix_dm_facet
Browse files Browse the repository at this point in the history
Removes the legacy dm facet file and fixes the IM / DM aliasing code …
  • Loading branch information
Leah Jones committed May 19, 2016
2 parents 82762ad + 73ebabb commit 2233f74
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 105 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v3.1.1 (2016-05-19)

* Removes the DM facet
* Updates the aliasing approach for IM / DM to correctly alias DM to the IM Facet

### v3.1.0 (2016-05-01)

* Updates the [`lib/clients/web/facets/index.js`](/lib/clients/web/facets/index.js) to reference the new facets added in the 3.0.0 update, thanks @ekmartin
Expand Down
5 changes: 3 additions & 2 deletions lib/clients/web/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ WebAPIClient.prototype._createFacets = function _createFacets() {
this[newFacet.name] = newFacet;
}, this);

// Alias the DM facet, so that it matches the docs
this.im = this.dm;
// Add a dm alias for the im and mpim facets
this.dm = this.im;
this.mpdm = this.mpim;
};


Expand Down
99 changes: 0 additions & 99 deletions lib/clients/web/facets/dm.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/clients/web/facets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module.exports = {
AuthFacet: require('./auth.js'),
ChannelsFacet: require('./channels.js'),
ChatFacet: require('./chat.js'),
DmFacet: require('./dm.js'),
DndFacet: require('./dnd.js'),
EmojiFacet: require('./emoji.js'),
FilesFacet: require('./files.js'),
FilesCommentsFacet: require('./files.comments.js'),
GroupsFacet: require('./groups.js'),
ImFacet: require('./im'),
MpimFacet: require('./mpim.js'),
OauthFacet: require('./oauth.js'),
PinsFacet: require('./pins.js'),
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": "3.1.0",
"version": "3.1.1",
"description": "A library for creating a Slack client",
"main": "./index",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions test/clients/web/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ describe('Web API Client', function () {
facets.forEach(function (Facet) {
var name = new Facet().name;
// The 'im' facet is aliased to dm:
if (name === 'im') {
expect(client[name].name).to.equal('dm');
if (name === 'dm') {
expect(client[name].name).to.equal('im');
} else {
expect(client[name].name).to.equal(name);
}
Expand Down

0 comments on commit 2233f74

Please sign in to comment.