diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2017-04-25 11:00:41 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-04-25 08:00:41 -0700 |
commit | db68e598a10d36013b7ff0994eca86e0464355e1 (patch) | |
tree | ec0f5e42c42d43afd4476f7e6b5ba9d3484577cc /app/notification.go | |
parent | cb668b92832193df7549c5a16543dcdfed44be56 (diff) | |
download | chat-db68e598a10d36013b7ff0994eca86e0464355e1.tar.gz chat-db68e598a10d36013b7ff0994eca86e0464355e1.tar.bz2 chat-db68e598a10d36013b7ff0994eca86e0464355e1.zip |
PLT-4457 Added API to get multiple users by their usernames (#6218)
* Allow getting profiles by username without a team
* Changed UserStore.GetProfilesByUsernames to return an array
* PLT-4457 Added API to get multiple users by their usernames
* Changed users/names route to users/usernames
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/notification.go b/app/notification.go index e983f5e8c..195f808c7 100644 --- a/app/notification.go +++ b/app/notification.go @@ -95,7 +95,7 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe if len(potentialOtherMentions) > 0 { if result := <-Srv.Store.User().GetProfilesByUsernames(potentialOtherMentions, team.Id); result.Err == nil { - outOfChannelMentions := result.Data.(map[string]*model.User) + outOfChannelMentions := result.Data.([]*model.User) go sendOutOfChannelMentions(sender, post, team.Id, outOfChannelMentions) } } @@ -592,13 +592,13 @@ func getMobileAppSessions(userId string) ([]*model.Session, *model.AppError) { } } -func sendOutOfChannelMentions(sender *model.User, post *model.Post, teamId string, profiles map[string]*model.User) *model.AppError { - if len(profiles) == 0 { +func sendOutOfChannelMentions(sender *model.User, post *model.Post, teamId string, users []*model.User) *model.AppError { + if len(users) == 0 { return nil } var usernames []string - for _, user := range profiles { + for _, user := range users { usernames = append(usernames, user.Username) } sort.Strings(usernames) |