aboutsummaryrefslogtreecommitdiff
path: root/persistence
diff options
context:
space:
mode:
Diffstat (limited to 'persistence')
-rw-r--r--persistence/sessions.go11
-rw-r--r--persistence/sessions_test.go1
2 files changed, 12 insertions, 0 deletions
diff --git a/persistence/sessions.go b/persistence/sessions.go
index c0750a3..1658cc9 100644
--- a/persistence/sessions.go
+++ b/persistence/sessions.go
@@ -41,6 +41,7 @@ type Session struct {
AsciiArrows bool `yaml:":asciiarrows"`
OOBMode bool `yaml:":oobmode"`
Carbons bool `yaml:":carbons"`
+ HideIds bool `yaml:":hideids"`
}
var configKeys = []string{
@@ -50,6 +51,7 @@ var configKeys = []string{
"asciiarrows",
"oobmode",
"carbons",
+ "hideids",
}
var sessionDB *SessionsYamlDB
@@ -126,6 +128,8 @@ func (s *Session) Get(key string) (string, error) {
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")
@@ -183,6 +187,13 @@ func (s *Session) Set(key string, value string) (string, error) {
}
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")
diff --git a/persistence/sessions_test.go b/persistence/sessions_test.go
index df5e26d..8ca6f4f 100644
--- a/persistence/sessions_test.go
+++ b/persistence/sessions_test.go
@@ -57,6 +57,7 @@ func TestSessionToMap(t *testing.T) {
"asciiarrows": "false",
"oobmode": "true",
"carbons": "false",
+ "hideids": "false",
}
if !reflect.DeepEqual(m, sample) {
t.Errorf("Map does not match the sample: %v", m)