From 6628a47f236f2d3d2c50023c2ed6552e650afcd6 Mon Sep 17 00:00:00 2001 From: Bruno Bierbaumer Date: Mon, 18 Jun 2018 22:55:45 +0200 Subject: Add channel password support for XMPP (#451) --- bridge/xmpp/xmpp.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bridge/xmpp') 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 } -- cgit v1.2.3