diff options
Diffstat (limited to 'app/channel.go')
-rw-r--r-- | app/channel.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/app/channel.go b/app/channel.go index db007dd3b..fb4198c37 100644 --- a/app/channel.go +++ b/app/channel.go @@ -226,18 +226,27 @@ func UpdateChannelMemberNotifyProps(data map[string]string, channelId string, us } // update whichever notify properties have been provided, but don't change the others - if markUnread, exists := data["mark_unread"]; exists { - member.NotifyProps["mark_unread"] = markUnread + if markUnread, exists := data[model.MARK_UNREAD_NOTIFY_PROP]; exists { + member.NotifyProps[model.MARK_UNREAD_NOTIFY_PROP] = markUnread } - if desktop, exists := data["desktop"]; exists { - member.NotifyProps["desktop"] = desktop + if desktop, exists := data[model.DESKTOP_NOTIFY_PROP]; exists { + member.NotifyProps[model.DESKTOP_NOTIFY_PROP] = desktop + } + + if email, exists := data[model.EMAIL_NOTIFY_PROP]; exists { + member.NotifyProps[model.EMAIL_NOTIFY_PROP] = email + } + + if push, exists := data[model.PUSH_NOTIFY_PROP]; exists { + member.NotifyProps[model.PUSH_NOTIFY_PROP] = push } if result := <-Srv.Store.Channel().UpdateMember(member); result.Err != nil { return nil, result.Err } else { InvalidateCacheForUser(userId) + InvalidateCacheForChannelMembersNotifyProps(channelId) return member, nil } } |