From 0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 5 Feb 2016 09:00:57 -0800 Subject: Fixing slash commands --- api/command.go | 15 +++++++++------ .../components/user_settings/manage_command_hooks.jsx | 16 ++-------------- web/static/i18n/en.json | 1 - web/static/i18n/es.json | 1 - 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/api/command.go b/api/command.go index a8573cdcc..e6fc8df3c 100644 --- a/api/command.go +++ b/api/command.go @@ -214,12 +214,15 @@ func handleResponse(c *Context, w http.ResponseWriter, response *model.CommandRe c.Err = model.NewLocAppError("command", "api.command.execute_command.save.app_error", nil, "") } } else if response.ResponseType == model.COMMAND_RESPONSE_TYPE_EPHEMERAL { - // post := &model.Post{} - // post.ChannelId = channelId - // post.Message = "TODO_EPHEMERAL: " + response.Text - // if _, err := CreatePost(c, post, true); err != nil { - // c.Err = model.NewLocAppError("command", "api.command.execute_command.save.app_error", nil, "") - // } + post := &model.Post{} + post.ChannelId = channelId + post.Message = response.Text + post.CreateAt = model.GetMillis() + SendEphemeralPost( + c.Session.TeamId, + c.Session.UserId, + post, + ) } w.Write([]byte(response.ToJson())) diff --git a/web/react/components/user_settings/manage_command_hooks.jsx b/web/react/components/user_settings/manage_command_hooks.jsx index b2fc0a4e1..948ab7885 100644 --- a/web/react/components/user_settings/manage_command_hooks.jsx +++ b/web/react/components/user_settings/manage_command_hooks.jsx @@ -537,17 +537,11 @@ export default class ManageCommandCmds extends React.Component { onChange={this.updateAutoComplete} /> -
- -
-
- -