From 42ed16bf9e9d72bf226045f1f291b9d58e2a6200 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sat, 18 Mar 2023 17:43:11 -0400 Subject: Simulate carbons --- persistence/sessions.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'persistence') diff --git a/persistence/sessions.go b/persistence/sessions.go index ed95f60..c0750a3 100644 --- a/persistence/sessions.go +++ b/persistence/sessions.go @@ -40,6 +40,7 @@ type Session struct { RawMessages bool `yaml:":rawmessages"` AsciiArrows bool `yaml:":asciiarrows"` OOBMode bool `yaml:":oobmode"` + Carbons bool `yaml:":carbons"` } var configKeys = []string{ @@ -48,6 +49,7 @@ var configKeys = []string{ "rawmessages", "asciiarrows", "oobmode", + "carbons", } var sessionDB *SessionsYamlDB @@ -122,6 +124,8 @@ func (s *Session) Get(key string) (string, error) { return fromBool(s.AsciiArrows), nil case "oobmode": return fromBool(s.OOBMode), nil + case "carbons": + return fromBool(s.Carbons), nil } return "", errors.New("Unknown session property") @@ -172,6 +176,13 @@ func (s *Session) Set(key string, value string) (string, error) { } s.OOBMode = b return value, nil + case "carbons": + b, err := toBool(value) + if err != nil { + return "", err + } + s.Carbons = b + return value, nil } return "", errors.New("Unknown session property") -- cgit v1.2.3