aboutsummaryrefslogtreecommitdiff
path: root/persistence/sessions.go
diff options
context:
space:
mode:
Diffstat (limited to 'persistence/sessions.go')
-rw-r--r--persistence/sessions.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/persistence/sessions.go b/persistence/sessions.go
index b42d3a3..cfea675 100644
--- a/persistence/sessions.go
+++ b/persistence/sessions.go
@@ -34,14 +34,16 @@ type SessionsMap struct {
// Session is a key-values subtree
type Session struct {
- Login string `yaml:":login"`
- Timezone string `yaml:":timezone"`
- KeepOnline bool `yaml:":keeponline"`
+ Login string `yaml:":login"`
+ Timezone string `yaml:":timezone"`
+ KeepOnline bool `yaml:":keeponline"`
+ RawMessages bool `yaml:":rawmessages"`
}
var configKeys = []string{
"timezone",
"keeponline",
+ "rawmessages",
}
var sessionDB *SessionsYamlDB
@@ -110,6 +112,8 @@ func (s *Session) Get(key string) (string, error) {
return s.Timezone, nil
case "keeponline":
return fromBool(s.KeepOnline), nil
+ case "rawmessages":
+ return fromBool(s.RawMessages), nil
}
return "", errors.New("Unknown session property")
@@ -139,6 +143,13 @@ func (s *Session) Set(key string, value string) (string, error) {
}
s.KeepOnline = b
return value, nil
+ case "rawmessages":
+ b, err := toBool(value)
+ if err != nil {
+ return "", err
+ }
+ s.RawMessages = b
+ return value, nil
}
return "", errors.New("Unknown session property")