diff options
author | Chris <ccbrown112@gmail.com> | 2017-07-25 11:36:14 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-07-25 11:36:14 -0700 |
commit | e5e450fc097c14110e942731018041cd1931aa25 (patch) | |
tree | 82c43790c6e5bf9ce6f38d773811b939cf3c9928 /api4/command.go | |
parent | 6418e912df647d38e22b75adc668824c7375073a (diff) | |
download | chat-e5e450fc097c14110e942731018041cd1931aa25.tar.gz chat-e5e450fc097c14110e942731018041cd1931aa25.tar.bz2 chat-e5e450fc097c14110e942731018041cd1931aa25.zip |
fix dm custom slash command regression (#7008)
Diffstat (limited to 'api4/command.go')
-rw-r--r-- | api4/command.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/api4/command.go b/api4/command.go index 47c37fe34..31361b00a 100644 --- a/api4/command.go +++ b/api4/command.go @@ -212,7 +212,13 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { return } - commandArgs.TeamId = channel.TeamId + if commandArgs.TeamId == "" { + commandArgs.TeamId = channel.TeamId + } else if c.Session.GetTeamByTeamId(commandArgs.TeamId) == nil { + c.SetPermissionError(model.PERMISSION_USE_SLASH_COMMANDS) + return + } + commandArgs.UserId = c.Session.UserId commandArgs.T = c.T commandArgs.Session = c.Session |