summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/session.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-09-17 15:19:18 +0200
committerWim <wim@42.be>2016-09-17 15:19:18 +0200
commit16ed2aca6a3da13ad7eae394028a5918b1a6e49f (patch)
tree45977475fc9bdda5b464e728562743d485023cf4 /vendor/github.com/mattermost/platform/model/session.go
parent0f530e7902f71c8f66b6b697a7d004e9f45bd9da (diff)
downloadmatterbridge-msglm-16ed2aca6a3da13ad7eae394028a5918b1a6e49f.tar.gz
matterbridge-msglm-16ed2aca6a3da13ad7eae394028a5918b1a6e49f.tar.bz2
matterbridge-msglm-16ed2aca6a3da13ad7eae394028a5918b1a6e49f.zip
Sync with mattermost 3.4.0
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/session.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/session.go6
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 "[]"