aboutsummaryrefslogtreecommitdiff
path: root/xmpp/handlers.go
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-11-12 18:50:25 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-11-12 18:50:25 +0300
commita5c97d68e77ca8c9c5518051f085051487cd0fbf (patch)
tree75e94674574fc613090bd2f05c88ec9d7f8d751d /xmpp/handlers.go
parentfbe99c65ec36bb0d8b3a508e0894a9830ff9c995 (diff)
Spawn TDlib instances for recovered sessions
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r--xmpp/handlers.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go
index ad6e3ba..c19a4ef 100644
--- a/xmpp/handlers.go
+++ b/xmpp/handlers.go
@@ -3,8 +3,6 @@ package xmpp
import (
"github.com/pkg/errors"
- "dev.narayana.im/narayana/telegabber/telegram"
-
log "github.com/sirupsen/logrus"
"gosrc.io/xmpp"
"gosrc.io/xmpp/stanza"
@@ -90,14 +88,9 @@ func handlePresence(s xmpp.Sender, p stanza.Presence) {
return
}
bareFromJid := fromJid.Bare()
- session, ok := sessions[bareFromJid]
+ session, ok := getTelegramInstance(bareFromJid, nil)
if !ok {
- client, err := telegram.NewClient(tgConf, bareFromJid)
- if err != nil {
- log.Error(errors.Wrap(err, "TDlib initialization failure"))
- return
- }
- sessions[bareFromJid] = client
+ return
}
switch p.Type {