diff options
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/session.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/session.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/platform/model/session.go b/vendor/github.com/mattermost/platform/model/session.go index ef51374d..e8b04fbe 100644 --- a/vendor/github.com/mattermost/platform/model/session.go +++ b/vendor/github.com/mattermost/platform/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 "[]" |