From e5e450fc097c14110e942731018041cd1931aa25 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 25 Jul 2017 11:36:14 -0700 Subject: fix dm custom slash command regression (#7008) --- api4/command.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'api4') 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 -- cgit v1.2.3-1-g7c22