aboutsummaryrefslogtreecommitdiff
path: root/telegram/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/commands.go')
-rw-r--r--telegram/commands.go19
1 files changed, 4 insertions, 15 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index 0200e05..039798f 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -362,16 +362,15 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) (strin
return notOnline, false
}
- for _, id := range c.cache.ChatsKeys() {
- c.unsubscribe(id)
- }
-
_, err := c.client.LogOut()
if err != nil {
- c.forceClose()
return errors.Wrap(err, "Logout error").Error(), false
}
+ for _, id := range c.cache.ChatsKeys() {
+ c.unsubscribe(id)
+ }
+
c.Session.Login = ""
// cancel auth
case "cancelauth":
@@ -466,16 +465,6 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) (strin
if gateway.MessageOutgoingPermissionVersion == 0 && args[0] == "carbons" && args[1] == "true" {
return "The server did not allow to enable carbons", false
}
- if !c.Session.RawMessages && args[0] == "nativeedits" && args[1] == "true" {
- return "nativeedits only works with rawmessages as of yet, enable it first", false
- }
- if c.Session.NativeEdits && args[0] == "rawmessages" && args[1] == "false" {
- _, err := c.Session.Set("nativeedits", "false")
- if err != nil {
- return err.Error(), false
- }
- msg = "Automatically disabling nativeedits too...\n"
- }
value, err := c.Session.Set(args[0], args[1])
if err != nil {