diff options
author | Wim <wim@42.be> | 2017-02-14 21:12:02 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-02-14 21:12:02 +0100 |
commit | 163f55f9c27e9e8a75774424d22598799e8306c6 (patch) | |
tree | 5c84a9443dfce24d98b4bd466f066efa8faae211 /bridge/xmpp | |
parent | 2d16fd085e91eb31264f7ff6e8cce76f79f0445b (diff) | |
download | matterbridge-msglm-163f55f9c27e9e8a75774424d22598799e8306c6.tar.gz matterbridge-msglm-163f55f9c27e9e8a75774424d22598799e8306c6.tar.bz2 matterbridge-msglm-163f55f9c27e9e8a75774424d22598799e8306c6.zip |
Refactor to handle disconnects/reconnects better.
Now try to reconnect every 60 seconds until forever.
Diffstat (limited to 'bridge/xmpp')
-rw-r--r-- | bridge/xmpp/xmpp.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 8899e718..4dcb8ef7 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -1,10 +1,10 @@ package bxmpp import ( + "crypto/tls" "github.com/42wim/matterbridge/bridge/config" log "github.com/Sirupsen/logrus" "github.com/mattn/go-xmpp" - "crypto/tls" "strings" "time" @@ -47,6 +47,10 @@ func (b *Bxmpp) Connect() error { return nil } +func (b *Bxmpp) Disconnect() error { + return nil +} + func (b *Bxmpp) JoinChannel(channel string) error { b.xc.JoinMUCNoHistory(channel+"@"+b.Config.Muc, b.Config.Nick) return nil @@ -63,11 +67,11 @@ func (b *Bxmpp) createXMPP() (*xmpp.Client, error) { tc.InsecureSkipVerify = b.Config.SkipTLSVerify tc.ServerName = strings.Split(b.Config.Server, ":")[0] options := xmpp.Options{ - Host: b.Config.Server, - User: b.Config.Jid, - Password: b.Config.Password, - NoTLS: true, - StartTLS: true, + Host: b.Config.Server, + User: b.Config.Jid, + Password: b.Config.Password, + NoTLS: true, + StartTLS: true, TLSConfig: tc, //StartTLS: false, |