summaryrefslogtreecommitdiffstats
path: root/api/command_join.go
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-20 09:14:18 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-20 09:14:18 -0400
commit981a08e80e3b686210f65c38ee8b8e831ab379e9 (patch)
treeff1e0deb9f7ffb83d2b0b5337fd3eab0fbc07ccc /api/command_join.go
parent36be959cd96fcc3c7791939e9f4a3e92d737284d (diff)
downloadchat-981a08e80e3b686210f65c38ee8b8e831ab379e9.tar.gz
chat-981a08e80e3b686210f65c38ee8b8e831ab379e9.tar.bz2
chat-981a08e80e3b686210f65c38ee8b8e831ab379e9.zip
Fixed double join messages (#3059)
Diffstat (limited to 'api/command_join.go')
-rw-r--r--api/command_join.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/api/command_join.go b/api/command_join.go
index af4443306..a2b1a2ddf 100644
--- a/api/command_join.go
+++ b/api/command_join.go
@@ -42,17 +42,9 @@ func (me *JoinProvider) DoCommand(c *Context, channelId string, message string)
if v.Name == message {
- if v.Type == model.CHANNEL_DIRECT {
+ if v.Type != model.CHANNEL_OPEN {
return &model.CommandResponse{Text: c.T("api.command_join.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
-
- JoinChannelById(c, c.Session.UserId, v.Id)
-
- if c.Err != nil {
- c.Err = nil
- return &model.CommandResponse{Text: c.T("api.command_join.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
- }
-
return &model.CommandResponse{GotoLocation: c.GetTeamURL() + "/channels/" + v.Name, Text: c.T("api.command_join.success"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
}