|
|
|
@ -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"))
|
|
|
|
|
}
|
|
|
|
|