diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2021-12-18 19:04:24 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2021-12-18 19:04:24 +0300 |
commit | f2f20e680bb06ebda76f67f8fae9d7ed12498c63 (patch) | |
tree | 03eaeefb422396a6af55128b6b62230a9dd39b43 /xmpp/component.go | |
parent | ad6e92e6d602c40e4bd44be785e00f563393192a (diff) |
Fix %!(MISSING) and other formatting issues
Diffstat (limited to 'xmpp/component.go')
-rw-r--r-- | xmpp/component.go | 12 |
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 } |