From 599cf16cdbb8567cf2ab1ce42aee5f493884de96 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Sat, 27 Jan 2024 06:13:45 -0500 Subject: Request and send to Telegram XEP-0333 displayed markers by "receipts" option --- persistence/sessions.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'persistence/sessions.go') diff --git a/persistence/sessions.go b/persistence/sessions.go index 1658cc9..56ff152 100644 --- a/persistence/sessions.go +++ b/persistence/sessions.go @@ -42,6 +42,7 @@ type Session struct { OOBMode bool `yaml:":oobmode"` Carbons bool `yaml:":carbons"` HideIds bool `yaml:":hideids"` + Receipts bool `yaml:":receipts"` } var configKeys = []string{ @@ -52,6 +53,7 @@ var configKeys = []string{ "oobmode", "carbons", "hideids", + "receipts", } var sessionDB *SessionsYamlDB @@ -130,6 +132,8 @@ func (s *Session) Get(key string) (string, error) { return fromBool(s.Carbons), nil case "hideids": return fromBool(s.HideIds), nil + case "receipts": + return fromBool(s.Receipts), nil } return "", errors.New("Unknown session property") @@ -194,6 +198,13 @@ func (s *Session) Set(key string, value string) (string, error) { } s.HideIds = b return value, nil + case "receipts": + b, err := toBool(value) + if err != nil { + return "", err + } + s.Receipts = b + return value, nil } return "", errors.New("Unknown session property") -- cgit v1.2.3