diff options
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 11 |
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 { |