aboutsummaryrefslogtreecommitdiff
path: root/persistence/sessions.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2024-01-29 12:28:15 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2024-01-29 12:28:15 +0300
commitea004b7f7c11fa0ddf560317fd9d6f9b2869144a (patch)
tree96157b08b5db8fde4088fde0cf1515be0c73bf6a /persistence/sessions.go
parentc141c4ad2bebe51562be0a7cfe0671f34b0a49fb (diff)
Reflect Telegram edits natively by nativeedits option
Diffstat (limited to 'persistence/sessions.go')
-rw-r--r--persistence/sessions.go11
1 files changed, 11 insertions, 0 deletions
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")