diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-08-31 12:52:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 12:52:14 -0400 |
commit | 26f96b240ddc8cf8c56decea72102b10238e0a43 (patch) | |
tree | 7eda509038de3d6b95a02b95bee2ad72e2e3a063 /model/session.go | |
parent | b0b39ce71cd77fbffbf23d56b20db1927f0c6cb1 (diff) | |
download | chat-26f96b240ddc8cf8c56decea72102b10238e0a43.tar.gz chat-26f96b240ddc8cf8c56decea72102b10238e0a43.tar.bz2 chat-26f96b240ddc8cf8c56decea72102b10238e0a43.zip |
PLT-3462 Add the ability to clear push notifications after channel is viewed (#3834)
* Add the ability to clear push notifications after channel is viewed
* Fix race condition between updating the mention count and reading it when sending push notifications
Diffstat (limited to 'model/session.go')
-rw-r--r-- | model/session.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/model/session.go b/model/session.go index ef51374db..e8b04fbe2 100644 --- a/model/session.go +++ b/model/session.go @@ -6,6 +6,7 @@ package model import ( "encoding/json" "io" + "strings" ) const ( @@ -109,6 +110,11 @@ func (me *Session) GetTeamByTeamId(teamId string) *TeamMember { return nil } +func (me *Session) IsMobileApp() bool { + return len(me.DeviceId) > 0 && + (strings.HasPrefix(me.DeviceId, PUSH_NOTIFY_APPLE+":") || strings.HasPrefix(me.DeviceId, PUSH_NOTIFY_ANDROID+":")) +} + func SessionsToJson(o []*Session) string { if b, err := json.Marshal(o); err != nil { return "[]" |