From ea004b7f7c11fa0ddf560317fd9d6f9b2869144a Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Mon, 29 Jan 2024 04:28:15 -0500 Subject: Reflect Telegram edits natively by nativeedits 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 56ff152..29c4918 100644 --- a/persistence/sessions.go +++ b/persistence/sessions.go @@ -43,6 +43,7 @@ type Session struct { Carbons bool `yaml:":carbons"` HideIds bool `yaml:":hideids"` Receipts bool `yaml:":receipts"` + NativeEdits bool `yaml:":nativeedits"` } var configKeys = []string{ @@ -54,6 +55,7 @@ var configKeys = []string{ "carbons", "hideids", "receipts", + "nativeedits", } var sessionDB *SessionsYamlDB @@ -134,6 +136,8 @@ func (s *Session) Get(key string) (string, error) { return fromBool(s.HideIds), nil case "receipts": return fromBool(s.Receipts), nil + case "nativeedits": + return fromBool(s.NativeEdits), nil } return "", errors.New("Unknown session property") @@ -205,6 +209,13 @@ func (s *Session) Set(key string, value string) (string, error) { } s.Receipts = b return value, nil + case "nativeedits": + b, err := toBool(value) + if err != nil { + return "", err + } + s.NativeEdits = b + return value, nil } return "", errors.New("Unknown session property") -- cgit v1.2.3