summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-05 09:00:57 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-05 09:00:57 -0800
commit0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb (patch)
tree182343657900829696e281620a3842e70f3ff2dd
parent4fabe574fadb3e35a5f87c31a421daf1cff57af8 (diff)
downloadchat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.tar.gz
chat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.tar.bz2
chat-0f1f3d24e5fc84ad2fafbeab6dc7f69fb91176cb.zip
Fixing slash commands
-rw-r--r--api/command.go15
-rw-r--r--web/react/components/user_settings/manage_command_hooks.jsx16
-rw-r--r--web/static/i18n/en.json1
-rw-r--r--web/static/i18n/es.json1
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}
/>
<FormattedMessage
- id='user.settings.cmds.auto_complete_desc_desc'
- defaultMessage='A short description of what this commands does'
+ id='user.settings.cmds.auto_complete_help'
+ defaultMessage='Show this command in autocomplete list'
/>
</label>
</div>
- <div className='padding-top'>
- <FormattedMessage
- id='user.settings.cmds.auto_complete_help'
- defaultMessage='Show this command in autocomplete list.'
- />
- </div>
</div>
<div className='padding-top x2'>
<label className='control-label'>
@@ -565,12 +559,6 @@ export default class ManageCommandCmds extends React.Component {
placeholder={this.props.intl.formatMessage(holders.addAutoCompleteDescPlaceholder)}
/>
</div>
- <div className='padding-top'>
- <FormattedMessage
- id='user.settings.cmds.auto_complete_desc_desc'
- defaultMessage='A short description of what this commands does'
- />
- </div>
</div>
<div className='padding-top x2'>
<label className='control-label'>
diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json
index caa4afae3..0bb238a90 100644
--- a/web/static/i18n/en.json
+++ b/web/static/i18n/en.json
@@ -1087,7 +1087,6 @@
"user.settings.cmds.username_desc": "The username to use when overriding the post.",
"user.settings.cmds.icon_url_desc": "URL to an icon",
"user.settings.cmds.trigger_desc": "Word to trigger on",
- "user.settings.cmds.auto_complete_desc_desc": "A short description of what this commands does",
"user.settings.cmds.auto_complete_help": "Show this command in autocomplete list.",
"user.settings.cmds.auto_complete_hint_desc": "List parameters to be passed to the command.",
"user.settings.cmds.request_type_desc": "Command request type issued to the callback URL.",
diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json
index b22a7cfd2..faac529b4 100644
--- a/web/static/i18n/es.json
+++ b/web/static/i18n/es.json
@@ -1074,7 +1074,6 @@
"user.settings.cmds.auto_complete.yes": "sí",
"user.settings.cmds.auto_complete_desc": "Descripción del Auto Completado: ",
"user.settings.cmds.auto_complete_desc.placeholder": "Una pequeña descripción de que hace el comando.",
- "user.settings.cmds.auto_complete_desc_desc": "Una pequeña descripción de que hace el comando",
"user.settings.cmds.auto_complete_help": "Mostrar este comando en la lista de auto completado.",
"user.settings.cmds.auto_complete_hint": "Pista de auto completado: ",
"user.settings.cmds.auto_complete_hint.placeholder": "[código postal]",