diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-20 10:34:31 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-20 10:34:31 -0600 |
commit | aac8d121a00922f007b9c67d890ea9dbcfbe4b8f (patch) | |
tree | 6bb1b242653aef8706254cbf144637e065cd49a4 /api/slackimport.go | |
parent | 3ac5ecf0e98823cab22c77d3a56393cbe6bbc19a (diff) | |
download | chat-aac8d121a00922f007b9c67d890ea9dbcfbe4b8f.tar.gz chat-aac8d121a00922f007b9c67d890ea9dbcfbe4b8f.tar.bz2 chat-aac8d121a00922f007b9c67d890ea9dbcfbe4b8f.zip |
PLT-7 adding loc db calls for posts table
Diffstat (limited to 'api/slackimport.go')
-rw-r--r-- | api/slackimport.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/slackimport.go b/api/slackimport.go index 6c392a6cf..8e6cc05c4 100644 --- a/api/slackimport.go +++ b/api/slackimport.go @@ -129,7 +129,7 @@ func SlackAddUsers(T goi18n.TranslateFunc, teamId string, slackusers []SlackUser return addedUsers } -func SlackAddPosts(channel *model.Channel, posts []SlackPost, users map[string]*model.User) { +func SlackAddPosts(T goi18n.TranslateFunc, channel *model.Channel, posts []SlackPost, users map[string]*model.User) { for _, sPost := range posts { switch { case sPost.Type == "message" && (sPost.SubType == "" || sPost.SubType == "file_share"): @@ -146,7 +146,7 @@ func SlackAddPosts(channel *model.Channel, posts []SlackPost, users map[string]* Message: sPost.Text, CreateAt: SlackConvertTimeStamp(sPost.TimeStamp), } - ImportPost(&newPost) + ImportPost(T, &newPost) case sPost.Type == "message" && sPost.SubType == "file_comment": if sPost.Comment["user"] == "" { l4g.Debug("Message without user") @@ -161,7 +161,7 @@ func SlackAddPosts(channel *model.Channel, posts []SlackPost, users map[string]* Message: sPost.Comment["comment"], CreateAt: SlackConvertTimeStamp(sPost.TimeStamp), } - ImportPost(&newPost) + ImportPost(T, &newPost) case sPost.Type == "message" && sPost.SubType == "bot_message": // In the future this will use the "Action Post" spec to post // a message without using a username. For now we just warn that we don't handle this case @@ -200,7 +200,7 @@ func SlackAddChannels(T goi18n.TranslateFunc, teamId string, slackchannels []Sla } log.WriteString(newChannel.DisplayName + "\r\n") addedChannels[sChannel.Id] = mChannel - SlackAddPosts(mChannel, posts[sChannel.Name], users) + SlackAddPosts(T, mChannel, posts[sChannel.Name], users) } return addedChannels |