From 7568e7172819ffc683c546d917654c16b89982d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Bru=CC=88ggebors?= Date: Wed, 3 Dec 2014 20:21:45 +0100 Subject: [PATCH] Add ability to join password protected chat rooms --- xmpp_muc.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xmpp_muc.go b/xmpp_muc.go index 0f14c4a..eeb1c89 100644 --- a/xmpp_muc.go +++ b/xmpp_muc.go @@ -27,6 +27,19 @@ func (c *Client) JoinMUC(jid, nick string) { xmlEscape(jid), xmlEscape(nick), nsMUC) } +// xep-0045 7.2.6 +func (c *Client) JoinProtectedMUC(jid, nick string, password string) { + if nick == "" { + nick = c.jid + } + fmt.Fprintf(c.conn, "\n"+ + "\n"+ + "%s\n"+ + "\n"+ + "", + xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password)) +} + // xep-0045 7.14 func (c *Client) LeaveMUC(jid string) { fmt.Fprintf(c.conn, "",