From e4fcbd3030f033c24102db9f6b6abfb540332c9d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 14 Jan 2015 12:38:46 +0100 Subject: Add support for password-protected IRC rooms. --- src/xmpp/xmpp_component.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/xmpp') diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index a1585d7..825193c 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -338,7 +338,9 @@ void XmppComponent::handle_presence(const Stanza& stanza) const std::string own_nick = bridge->get_own_nick(iid); if (!own_nick.empty() && own_nick != to.resource) bridge->send_irc_nick_change(iid, to.resource); - bridge->join_irc_channel(iid, to.resource); + XmlNode* x = stanza.get_child("x", MUC_NS); + XmlNode* password = x? x->get_child("password", MUC_NS): NULL; + bridge->join_irc_channel(iid, to.resource, password? password->get_inner(): ""); } else if (type == "unavailable") { -- cgit v1.2.3