aboutsummaryrefslogtreecommitdiff
path: root/xmpp/component.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/component.go')
-rw-r--r--xmpp/component.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/xmpp/component.go b/xmpp/component.go
index bbf0483..d1d0ddf 100644
--- a/xmpp/component.go
+++ b/xmpp/component.go
@@ -11,6 +11,7 @@ import (
log "github.com/sirupsen/logrus"
"gosrc.io/xmpp"
+ "gosrc.io/xmpp/stanza"
)
var tgConf config.TelegramConfig
@@ -22,7 +23,7 @@ var db *persistence.SessionsYamlDB
func NewComponent(conf config.XMPPConfig, tc config.TelegramConfig) (*xmpp.StreamManager, *xmpp.Component, error) {
var err error
- gateway.Jid, err = xmpp.NewJid(conf.Jid)
+ gateway.Jid, err = stanza.NewJid(conf.Jid)
if err != nil {
return nil, nil, err
}
@@ -30,7 +31,10 @@ func NewComponent(conf config.XMPPConfig, tc config.TelegramConfig) (*xmpp.Strea
tgConf = tc
options := xmpp.ComponentOptions{
- Address: conf.Host + ":" + conf.Port,
+ TransportConfiguration: xmpp.TransportConfiguration{
+ Address: conf.Host + ":" + conf.Port,
+ Domain: conf.Jid,
+ },
Domain: conf.Jid,
Secret: conf.Password,
Name: "telegabber",
@@ -41,7 +45,9 @@ func NewComponent(conf config.XMPPConfig, tc config.TelegramConfig) (*xmpp.Strea
router.HandleFunc("presence", HandlePresence)
router.HandleFunc("message", HandleMessage)
- component, err := xmpp.NewComponent(options, router)
+ component, err := xmpp.NewComponent(options, router, func(err error) {
+ log.Error(err)
+ })
if err != nil {
return nil, nil, err
}