Migrate "User.GetProfilesByUsernames" to Sync by default (#11523)

* changed GetProfilesByUsernames signature

* modified the UserStore interface to reflect changed made to the GetProfilesByUsernames function signature

* modify usages of GetProfilesByUsernames

* fix gofmt

* fixed failing userstore tests
Этот коммит содержится в:
Phillip Ahereza
2019-07-05 22:19:40 +03:00
коммит произвёл Elias Nahum
родитель aa14c9bbdb
Коммит c34942afec
6 изменённых файлов: 53 добавлений и 48 удалений

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

@@ -141,8 +141,8 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
}
if len(m.OtherPotentialMentions) > 0 && !post.IsSystemMessage() {
if profilesResult := <-a.Srv.Store.User().GetProfilesByUsernames(m.OtherPotentialMentions, &model.ViewUsersRestrictions{Teams: []string{team.Id}}); profilesResult.Err == nil {
channelMentions := model.UserSlice(profilesResult.Data.([]*model.User)).FilterByActive(true)
if users, err := a.Srv.Store.User().GetProfilesByUsernames(m.OtherPotentialMentions, &model.ViewUsersRestrictions{Teams: []string{team.Id}}); err == nil {
channelMentions := model.UserSlice(users).FilterByActive(true)
var outOfChannelMentions model.UserSlice
var outOfGroupsMentions model.UserSlice