diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-09-02 12:50:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 12:50:15 -0400 |
commit | f32eb525f3fa0828a23f589d765c267e3b2aea86 (patch) | |
tree | d4b76aecf89143029af080b3e1b4d87398e0adc5 /model/user.go | |
parent | eb0111f6bbe2b0bf160a674dfe1b4d089f905cb9 (diff) | |
download | chat-f32eb525f3fa0828a23f589d765c267e3b2aea86.tar.gz chat-f32eb525f3fa0828a23f589d765c267e3b2aea86.tar.bz2 chat-f32eb525f3fa0828a23f589d765c267e3b2aea86.zip |
Do not send push notifications for channels being actively viewed (#3931)
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/model/user.go b/model/user.go index 8917658df..434ce2732 100644 --- a/model/user.go +++ b/model/user.go @@ -378,24 +378,6 @@ func (u *User) IsLDAPUser() bool { return false } -func (u *User) StatusAllowsPushNotification(status *Status) bool { - props := u.NotifyProps - - if props["push"] == "none" { - return false - } - - if pushStatus, ok := props["push_status"]; pushStatus == STATUS_ONLINE || !ok { - return true - } else if pushStatus == STATUS_AWAY && (status.Status == STATUS_AWAY || status.Status == STATUS_OFFLINE) { - return true - } else if pushStatus == STATUS_OFFLINE && status.Status == STATUS_OFFLINE { - return true - } - - return false -} - // UserFromJson will decode the input and return a User func UserFromJson(data io.Reader) *User { decoder := json.NewDecoder(data) |