mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
27 lines
939 B
JavaScript
27 lines
939 B
JavaScript
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {browserHistory} from 'react-router';
|
|
import * as Utils from 'utils/utils.jsx';
|
|
import TeamStore from 'stores/team_store.jsx';
|
|
import UserStore from 'stores/user_store.jsx';
|
|
import Client from 'utils/web_client.jsx';
|
|
|
|
export function goToChannel(channel) {
|
|
if (channel.fake) {
|
|
Utils.openDirectChannelToUser(
|
|
UserStore.getProfileByUsername(channel.display_name),
|
|
() => {
|
|
browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/' + channel.name);
|
|
},
|
|
null
|
|
);
|
|
} else {
|
|
browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/' + channel.name);
|
|
}
|
|
}
|
|
|
|
export function executeCommand(channelId, message, suggest, success, error) {
|
|
Client.executeCommand(channelId, message, suggest, success, error);
|
|
}
|