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

adds MPIMs to the datastore on rtm.start #389

Merged
merged 2 commits into from Aug 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/data-store/data-store.js
Expand Up @@ -409,6 +409,12 @@ SlackDataStore.prototype.cacheRtmStart = function cacheRtmStart(data) {
forEach(data.groups || [], bind(function cacheRtmGroup(group) {
this.setGroup(new models.Group(group));
}, this));
forEach(data.mpims || [], bind(function cacheRtmMpim(mpim) {
// MPIMs are basically groups (they have the same prefix)
// NOTE: there is a Model class for MPDM, and it is used in the model helpers `getModelClass`
// so this could be introducing some inconsistencies in behavior.
this.setGroup(new models.Group(mpim));
}, this));
forEach(data.bots || [], bind(function cacheRtmBot(bot) {
// Bots don't have a separate type currently, so treat them as simple objects
this.setBot(bot);
Expand Down