PLT-7 adding loc db calls for posts table

Этот коммит содержится в:
=Corey Hulen
2016-01-20 10:34:31 -06:00
родитель 3ac5ecf0e9
Коммит aac8d121a0
10 изменённых файлов: 182 добавлений и 181 удалений

Просмотреть файл

@@ -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