diff options
author | David Lu <david.lu@hotmail.com> | 2016-07-14 15:57:06 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-07-14 11:57:06 -0800 |
commit | 34077a407b1aeab2d1510471d59a50108f0ec699 (patch) | |
tree | cefdcd423861af2566d752b46cb80d394312982c /api/command_shortcuts.go | |
parent | 0b200cc9245193aa01b00ecc8bf41483f6b32e7e (diff) | |
download | chat-34077a407b1aeab2d1510471d59a50108f0ec699.tar.gz chat-34077a407b1aeab2d1510471d59a50108f0ec699.tar.bz2 chat-34077a407b1aeab2d1510471d59a50108f0ec699.zip |
made /shortcuts separate for mac (#3571)
Diffstat (limited to 'api/command_shortcuts.go')
-rw-r--r-- | api/command_shortcuts.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/api/command_shortcuts.go b/api/command_shortcuts.go index 77f9f4441..0cdf821c8 100644 --- a/api/command_shortcuts.go +++ b/api/command_shortcuts.go @@ -5,6 +5,7 @@ package api import ( "github.com/mattermost/platform/model" + "strings" ) type ShortcutsProvider struct { @@ -33,5 +34,11 @@ func (me *ShortcutsProvider) GetCommand(c *Context) *model.Command { } func (me *ShortcutsProvider) DoCommand(c *Context, channelId string, message string) *model.CommandResponse { - return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T("api.command_shortcuts.list")} + stringId := "api.command_shortcuts.list" + + if strings.Contains(message, "mac") { + stringId = "api.command_shortcuts.list_mac" + } + + return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: c.T(stringId)} } |