aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-11-21 00:45:30 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-11-21 00:45:30 +0300
commitc0c21a35a4cfd326423ad530926a0e96c1b07dcf (patch)
treec1b4cc2f019b051c0269b0f92f1aa48eabf4feb5 /xmpp/handlers.go
parentf0c0d0ba94c923ca06b49211c70db47616e5a8e1 (diff)
Handle unsubscribe presence too, improve logging
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index 70f985d..ba93a11 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -96,7 +96,7 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
}
switch p.Type {
- case "unsubscribed":
+ case "unsubscribed", "unsubscribe":
session.Disconnect()
delete(sessions, bareFromJid)
case "unavailable", "error":
@@ -105,7 +105,7 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
// due to the weird implentation of go-tdlib wrapper, it won't
// return the client instance until successful authorization
go func() {
- session.Connect()
+ err = session.Connect()
if err != nil {
log.Error(errors.Wrap(err, "TDlib connection failure"))
}