Commit 89852d04 authored by Jesús Espino's avatar Jesús Espino Committed by George Goldberg

When leave a channel the push notification can fail (#9478)

parent e77f9d06
...@@ -1565,7 +1565,13 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, clearPush ...@@ -1565,7 +1565,13 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, clearPush
if *a.Config().EmailSettings.SendPushNotifications && clearPushNotifications { if *a.Config().EmailSettings.SendPushNotifications && clearPushNotifications {
for _, channelId := range channelIds { for _, channelId := range channelIds {
if model.IsValidId(channelId) { if model.IsValidId(channelId) {
member := (<-a.Srv.Store.Channel().GetMember(channelId, userId)).Data.(*model.ChannelMember) result := <-a.Srv.Store.Channel().GetMember(channelId, userId)
if result.Err != nil {
mlog.Warn(fmt.Sprintf("Failed to get membership %v", result.Err))
continue
}
member := result.Data.(*model.ChannelMember)
notify := member.NotifyProps[model.PUSH_NOTIFY_PROP] notify := member.NotifyProps[model.PUSH_NOTIFY_PROP]
if notify == model.CHANNEL_NOTIFY_DEFAULT { if notify == model.CHANNEL_NOTIFY_DEFAULT {
user, _ := a.GetUser(userId) user, _ := a.GetUser(userId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment