4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-29 02:36:17 +00:00

Sync with mattermost 3.5.0

This commit is contained in:
Wim
2016-11-12 22:00:53 +01:00
parent 08ebee6b4f
commit 1d5cd1d7c4
32 changed files with 1476 additions and 430 deletions

View File

@ -11,7 +11,7 @@ import (
const (
SESSION_COOKIE_TOKEN = "MMAUTHTOKEN"
SESSION_CACHE_SIZE = 10000
SESSION_CACHE_SIZE = 25000
SESSION_PROP_PLATFORM = "platform"
SESSION_PROP_OS = "os"
SESSION_PROP_BROWSER = "browser"
@ -115,6 +115,10 @@ func (me *Session) IsMobileApp() bool {
(strings.HasPrefix(me.DeviceId, PUSH_NOTIFY_APPLE+":") || strings.HasPrefix(me.DeviceId, PUSH_NOTIFY_ANDROID+":"))
}
func (me *Session) GetUserRoles() []string {
return strings.Fields(me.Roles)
}
func SessionsToJson(o []*Session) string {
if b, err := json.Marshal(o); err != nil {
return "[]"