diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-19 03:13:00 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-03-19 03:13:00 +0300 |
commit | 0a2c4e09d9179108208461a58990f3397dad5a6c (patch) | |
tree | e437ddc32498c6ce424557e53353639c8ee4b1ef /persistence/sessions.go | |
parent | 22b46c71ce932cc97fa6d437a7473a653bb59a41 (diff) |
Add `hideids` configuration option
Diffstat (limited to 'persistence/sessions.go')
-rw-r--r-- | persistence/sessions.go | 11 |
1 files changed, 11 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") |