4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-27 15:49:23 +00:00

Sync with mattermost 3.4.0

This commit is contained in:
Wim
2016-09-17 15:19:18 +02:00
parent 0f530e7902
commit 16ed2aca6a
13 changed files with 225 additions and 36 deletions

View File

@ -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 "[]"