diff options
author | Bruno Bierbaumer <bruno+github@bierbaumer.net> | 2018-06-18 22:55:45 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2018-06-18 22:55:45 +0200 |
commit | 6628a47f236f2d3d2c50023c2ed6552e650afcd6 (patch) | |
tree | 40eba1b4c2fb42a36c2c349ca86d70a760794b46 /bridge/xmpp/xmpp.go | |
parent | ec0e6bc3f8a032631f5374e35b1faa486c5b6405 (diff) | |
download | matterbridge-msglm-6628a47f236f2d3d2c50023c2ed6552e650afcd6.tar.gz matterbridge-msglm-6628a47f236f2d3d2c50023c2ed6552e650afcd6.tar.bz2 matterbridge-msglm-6628a47f236f2d3d2c50023c2ed6552e650afcd6.zip |
Add channel password support for XMPP (#451)
Diffstat (limited to 'bridge/xmpp/xmpp.go')
-rw-r--r-- | bridge/xmpp/xmpp.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 0e2d951c..4ace2abd 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -65,7 +65,12 @@ func (b *Bxmpp) Disconnect() error { } func (b *Bxmpp) JoinChannel(channel config.ChannelInfo) error { - b.xc.JoinMUCNoHistory(channel.Name+"@"+b.GetString("Muc"), b.GetString("Nick")) + if channel.Options.Key != "" { + b.Log.Debugf("using key %s for channel %s", channel.Options.Key, channel.Name) + b.xc.JoinProtectedMUC(channel.Name+"@"+b.GetString("Muc"), b.GetString("Nick"), channel.Options.Key, xmpp.NoHistory, 0, nil) + } else { + b.xc.JoinMUCNoHistory(channel.Name+"@"+b.GetString("Muc"), b.GetString("Nick")) + } return nil } |