diff options
Diffstat (limited to 'telegram/commands.go')
-rw-r--r-- | telegram/commands.go | 14 |
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 { |