summaryrefslogtreecommitdiffstats
path: root/bridge/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/xmpp')
-rw-r--r--bridge/xmpp/xmpp.go7
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
}