summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-27 11:52:34 -0500
committerSaturnino Abril <saturnino.abril@gmail.com>2017-09-28 00:52:34 +0800
commit8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df (patch)
treeb3563dfe35ad78991774c9d1842dc439376e1db1 /app/notification.go
parent1bd66589a2adc67df5df9c108a2f2ecc77dfdf44 (diff)
downloadchat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.tar.gz
chat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.tar.bz2
chat-8c80cdde38cceb3424b2b1f43eadf7a1aab0c6df.zip
remove remaining Global() calls (outside of tests) (#7521)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/notification.go b/app/notification.go
index cc3db8b55..0859dfd20 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -94,7 +94,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
if result := <-a.Srv.Store.User().GetProfilesByUsernames(potentialOtherMentions, team.Id); result.Err == nil {
outOfChannelMentions := result.Data.([]*model.User)
if channel.Type != model.CHANNEL_GROUP {
- go sendOutOfChannelMentions(sender, post, team.Id, outOfChannelMentions)
+ go a.sendOutOfChannelMentions(sender, post, team.Id, outOfChannelMentions)
}
}
}
@@ -186,7 +186,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
// If the channel has more than 1K users then @here is disabled
if hereNotification && int64(len(profileMap)) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel {
hereNotification = false
- SendEphemeralPost(
+ a.SendEphemeralPost(
post.UserId,
&model.Post{
ChannelId: post.ChannelId,
@@ -198,7 +198,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
// If the channel has more than 1K users then @channel is disabled
if channelNotification && int64(len(profileMap)) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel {
- SendEphemeralPost(
+ a.SendEphemeralPost(
post.UserId,
&model.Post{
ChannelId: post.ChannelId,
@@ -210,7 +210,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
// If the channel has more than 1K users then @all is disabled
if allNotification && int64(len(profileMap)) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel {
- SendEphemeralPost(
+ a.SendEphemeralPost(
post.UserId,
&model.Post{
ChannelId: post.ChannelId,
@@ -298,7 +298,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
message.Add("mentions", model.ArrayToJson(mentionedUsersList))
}
- Publish(message)
+ a.Publish(message)
return mentionedUsersList, nil
}
@@ -337,7 +337,7 @@ func (a *App) sendNotificationEmail(post *model.Post, user *model.User, channel
}
if sendBatched {
- if err := AddNotificationEmailToBatch(user, post, team); err == nil {
+ if err := a.AddNotificationEmailToBatch(user, post, team); err == nil {
return nil
}
}
@@ -717,7 +717,7 @@ func (a *App) getMobileAppSessions(userId string) ([]*model.Session, *model.AppE
}
}
-func sendOutOfChannelMentions(sender *model.User, post *model.Post, teamId string, users []*model.User) *model.AppError {
+func (a *App) sendOutOfChannelMentions(sender *model.User, post *model.Post, teamId string, users []*model.User) *model.AppError {
if len(users) == 0 {
return nil
}
@@ -742,7 +742,7 @@ func sendOutOfChannelMentions(sender *model.User, post *model.Post, teamId strin
})
}
- SendEphemeralPost(
+ a.SendEphemeralPost(
post.UserId,
&model.Post{
ChannelId: post.ChannelId,