aboutsummaryrefslogtreecommitdiff
path: root/persistence/sessions.go
diff options
context:
space:
mode:
Diffstat (limited to 'persistence/sessions.go')
-rw-r--r--persistence/sessions.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/persistence/sessions.go b/persistence/sessions.go
index 18d748e..dc5de46 100644
--- a/persistence/sessions.go
+++ b/persistence/sessions.go
@@ -40,6 +40,9 @@ type Session struct {
RawMessages bool `yaml:":rawmessages"`
AsciiArrows bool `yaml:":asciiarrows"`
MUC bool `yaml:":muc"`
+ OOBMode bool `yaml:":oobmode"`
+ Carbons bool `yaml:":carbons"`
+ HideIds bool `yaml:":hideids"`
}
var configKeys = []string{
@@ -48,6 +51,9 @@ var configKeys = []string{
"rawmessages",
"asciiarrows",
"muc",
+ "oobmode",
+ "carbons",
+ "hideids",
}
var sessionDB *SessionsYamlDB
@@ -122,6 +128,12 @@ func (s *Session) Get(key string) (string, error) {
return fromBool(s.AsciiArrows), nil
case "muc":
return fromBool(s.MUC), nil
+ case "oobmode":
+ return fromBool(s.OOBMode), nil
+ case "carbons":
+ return fromBool(s.Carbons), nil
+ case "hideids":
+ return fromBool(s.HideIds), nil
}
return "", errors.New("Unknown session property")
@@ -172,6 +184,27 @@ func (s *Session) Set(key string, value string) (string, error) {
}
s.MUC = b
return value, nil
+ case "oobmode":
+ b, err := toBool(value)
+ if err != nil {
+ return "", err
+ }
+ s.OOBMode = b
+ return value, nil
+ case "carbons":
+ b, err := toBool(value)
+ if err != nil {
+ return "", err
+ }
+ s.Carbons = b
+ return value, nil
+ case "hideids":
+ b, err := toBool(value)
+ if err != nil {
+ return "", err
+ }
+ s.HideIds = b
+ return value, nil
}
return "", errors.New("Unknown session property")