diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-01-27 14:13:45 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2024-01-27 14:13:45 +0300 |
commit | 599cf16cdbb8567cf2ab1ce42aee5f493884de96 (patch) | |
tree | bc9be25328223d6ce5b3c3d3868496dd0ccdc75e /persistence/sessions.go | |
parent | 81fc3ea3707cdf73b846ab55b2ecc5b8f68ccd21 (diff) |
Request and send to Telegram XEP-0333 displayed markers by "receipts" 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 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") |