aboutsummaryrefslogtreecommitdiff
path: root/persistence/sessions.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-14 03:05:59 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-14 03:05:59 +0300
commit915c40f1eed6ba139323c0fa15eed4ed3792f34b (patch)
treeb7e67604ea0451e2cc19f532a2c0954614eabd52 /persistence/sessions.go
parent6cbfed824520e742532db502147d9c6bc524cc84 (diff)
Add an asciiarrows option (for clients that do not support Unicode ones)v1.1.2
Diffstat (limited to 'persistence/sessions.go')
-rw-r--r--persistence/sessions.go11
1 files changed, 11 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")