* Use ImageBackground for youtube videos instead of nested Images * Fix bugs reported by sentry (#1081) * Update Mattermost redux (#1086) * Fix middleware * Upgrade mattermost-redux * another middleware fix * RN-456 when a channel is left we update content and title (#1087) * Version Bump to 62 (#1088) * Version Bump to 62 (#1089)
16 lines
719 B
JavaScript
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';
|
|
}
|