aboutsummaryrefslogtreecommitdiff
path: root/telegram/commands.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 /telegram/commands.go
parentc141c4ad2bebe51562be0a7cfe0671f34b0a49fb (diff)
Reflect Telegram edits natively by nativeedits option
Diffstat (limited to 'telegram/commands.go')
-rw-r--r--telegram/commands.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index b5c856e..9251ebb 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -201,6 +201,7 @@ func (c *Client) sendMessagesReverse(chatID int64, messages []*client.Message) {
strconv.FormatInt(message.Id, 10),
c.xmpp,
reply,
+ "",
false,
false,
)
@@ -380,9 +381,20 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string
}
case "config":
if len(args) > 1 {
+ var msg string
if gateway.MessageOutgoingPermissionVersion == 0 && args[0] == "carbons" && args[1] == "true" {
return "The server did not allow to enable carbons"
}
+ if !c.Session.RawMessages && args[0] == "nativeedits" && args[1] == "true" {
+ return "nativeedits only works with rawmessages as of yet, enable it first"
+ }
+ if c.Session.NativeEdits && args[0] == "rawmessages" && args[1] == "false" {
+ _, err := c.Session.Set("nativeedits", "false")
+ if err != nil {
+ return err.Error()
+ }
+ msg = "Automatically disabling nativeedits too...\n"
+ }
value, err := c.Session.Set(args[0], args[1])
if err != nil {
@@ -390,7 +402,7 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string
}
gateway.DirtySessions = true
- return fmt.Sprintf("%s set to %s", args[0], value)
+ return fmt.Sprintf("%s%s set to %s", msg, args[0], value)
} else if len(args) > 0 {
value, err := c.Session.Get(args[0])
if err != nil {