diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-09-27 16:10:09 +0200 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2018-09-27 15:10:09 +0100 |
commit | 89852d04c064588f24c6122caf18b8e656399f94 (patch) | |
tree | 537aae5a96742e9bb00b76b9bd7665e2ae430444 /app | |
parent | e77f9d06f5f50cac7c666c1e3fa955f974a8019d (diff) | |
download | chat-89852d04c064588f24c6122caf18b8e656399f94.tar.gz chat-89852d04c064588f24c6122caf18b8e656399f94.tar.bz2 chat-89852d04c064588f24c6122caf18b8e656399f94.zip |
When leave a channel the push notification can fail (#9478)
Diffstat (limited to 'app')
-rw-r--r-- | app/channel.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/channel.go b/app/channel.go index 84a334c66..30fc2c1b6 100644 --- a/app/channel.go +++ b/app/channel.go @@ -1565,7 +1565,13 @@ func (a *App) MarkChannelsAsViewed(channelIds []string, userId string, clearPush if *a.Config().EmailSettings.SendPushNotifications && clearPushNotifications { for _, channelId := range channelIds { 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] if notify == model.CHANNEL_NOTIFY_DEFAULT { user, _ := a.GetUser(userId) |