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 cfea675..bc71fd6 100644
--- a/persistence/sessions.go
+++ b/persistence/sessions.go
@@ -38,12 +38,14 @@ type Session struct {
Timezone string `yaml:":timezone"`
KeepOnline bool `yaml:":keeponline"`
RawMessages bool `yaml:":rawmessages"`
+ AsciiArrows bool `yaml:":asciiarrows"`
}
var configKeys = []string{
"timezone",
"keeponline",
"rawmessages",
+ "asciiarrows",
}
var sessionDB *SessionsYamlDB
@@ -114,6 +116,8 @@ func (s *Session) Get(key string) (string, error) {
return fromBool(s.KeepOnline), nil
case "rawmessages":
return fromBool(s.RawMessages), nil
+ case "asciiarrows":
+ return fromBool(s.AsciiArrows), nil
}
return "", errors.New("Unknown session property")
@@ -150,6 +154,13 @@ func (s *Session) Set(key string, value string) (string, error) {
}
s.RawMessages = b
return value, nil
+ case "asciiarrows":
+ b, err := toBool(value)
+ if err != nil {
+ return "", err
+ }
+ s.AsciiArrows = b
+ return value, nil
}
return "", errors.New("Unknown session property")
diff --git a/persistence/sessions_test.go b/persistence/sessions_test.go
index aa1f4b8..76f71f9 100644
--- a/persistence/sessions_test.go
+++ b/persistence/sessions_test.go
@@ -53,6 +53,7 @@ func TestSessionToMap(t *testing.T) {
"timezone": "klsf",
"keeponline": "false",
"rawmessages": "true",
+ "asciiarrows": "false",
}
if !reflect.DeepEqual(m, sample) {
t.Errorf("Map does not match the sample: %v", m)