summaryrefslogtreecommitdiffstats
path: root/webapp/actions/channel_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/channel_actions.jsx')
-rw-r--r--webapp/actions/channel_actions.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index 5dc83379e..68020651d 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -2,12 +2,23 @@
// 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) {
- browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/' + channel.name);
+ 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) {