summaryrefslogtreecommitdiffstats
path: root/api/command_msg.go
diff options
context:
space:
mode:
authorDavid Lu <david.lu97@outlook.com>2016-08-19 08:08:31 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-08-19 08:08:31 -0400
commit8c2ea22892079cb7f72be96ae6ddff165cda6e43 (patch)
tree8b7cc90ec3ca8d3cdb2437dcf726174e74a9903e /api/command_msg.go
parent9ad50d4d7562c1b029c888e892dd7cfc203f938a (diff)
downloadchat-8c2ea22892079cb7f72be96ae6ddff165cda6e43.tar.gz
chat-8c2ea22892079cb7f72be96ae6ddff165cda6e43.tar.bz2
chat-8c2ea22892079cb7f72be96ae6ddff165cda6e43.zip
Refactored CreatePost to not use context (#3813)
Diffstat (limited to 'api/command_msg.go')
-rw-r--r--api/command_msg.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/command_msg.go b/api/command_msg.go
index d32a7ca5e..f54190f58 100644
--- a/api/command_msg.go
+++ b/api/command_msg.go
@@ -4,8 +4,9 @@
package api
import (
- "github.com/mattermost/platform/model"
"strings"
+
+ "github.com/mattermost/platform/model"
)
type msgProvider struct {
@@ -83,7 +84,8 @@ func (me *msgProvider) DoCommand(c *Context, channelId string, message string) *
post := &model.Post{}
post.Message = parsedMessage
post.ChannelId = targetChannelId
- if _, err := CreatePost(c, post, true); err != nil {
+ post.UserId = c.Session.UserId
+ if _, err := CreatePost(c.TeamId, post, true); err != nil {
return &model.CommandResponse{Text: c.T("api.command_msg.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
}