Do not send push notifications for channels being actively viewed (#3931)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
eb0111f6bb
Коммит
f32eb525f3
11
api/post.go
11
api/post.go
@@ -682,7 +682,7 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
|
||||
var status *model.Status
|
||||
var err *model.AppError
|
||||
if status, err = GetStatus(id); err != nil {
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0}
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""}
|
||||
}
|
||||
|
||||
if userAllowsEmails && status.Status != model.STATUS_ONLINE {
|
||||
@@ -739,10 +739,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
|
||||
var status *model.Status
|
||||
var err *model.AppError
|
||||
if status, err = GetStatus(id); err != nil {
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0}
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""}
|
||||
}
|
||||
|
||||
if profileMap[id].StatusAllowsPushNotification(status) {
|
||||
if DoesStatusAllowPushNotification(profileMap[id], status, post.ChannelId) {
|
||||
sendPushNotification(post, profileMap[id], channel, senderName, true)
|
||||
}
|
||||
}
|
||||
@@ -752,10 +752,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
|
||||
var status *model.Status
|
||||
var err *model.AppError
|
||||
if status, err = GetStatus(id); err != nil {
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0}
|
||||
status = &model.Status{id, model.STATUS_OFFLINE, false, 0, ""}
|
||||
}
|
||||
|
||||
if profileMap[id].StatusAllowsPushNotification(status) {
|
||||
if DoesStatusAllowPushNotification(profileMap[id], status, post.ChannelId) {
|
||||
sendPushNotification(post, profileMap[id], channel, senderName, false)
|
||||
}
|
||||
}
|
||||
@@ -945,7 +945,6 @@ func sendPushNotification(post *model.Post, user *model.User, channel *model.Cha
|
||||
|
||||
func clearPushNotification(userId string, channelId string) {
|
||||
session := getMobileAppSession(userId)
|
||||
|
||||
if session == nil {
|
||||
return
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user