mattermost-mobile/app/utils/channels.js
enahum 388294a124
Update Mattermost redux (#1086)
* Fix middleware

* Upgrade mattermost-redux

* another middleware fix
2017-11-02 16:09:53 -03:00

16 lines
719 B
JavaScript

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {Preferences} from 'mattermost-redux/constants';
import {getUserIdFromChannelName} from 'mattermost-redux/utils/channel_utils';
export function isDirectChannelVisible(userId, myPreferences, channel) {
const channelId = getUserIdFromChannelName(userId, channel.name);
const dm = myPreferences[`${Preferences.CATEGORY_DIRECT_CHANNEL_SHOW}--${channelId}`];
return dm && dm.value === 'true';
}
export function isGroupChannelVisible(myPreferences, channel) {
const gm = myPreferences[`${Preferences.CATEGORY_GROUP_CHANNEL_SHOW}--${channel.id}`];
return gm && gm.value === 'true';
}