diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2015-01-14 12:38:46 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2015-01-14 12:38:46 +0100 |
commit | e4fcbd3030f033c24102db9f6b6abfb540332c9d (patch) | |
tree | c3a491ccab00c1b77c52f138869a636cfe69880d /src/xmpp | |
parent | e2e2f3089469e3e2acbdf1ac6902241d994057c6 (diff) | |
download | biboumi-e4fcbd3030f033c24102db9f6b6abfb540332c9d.tar.gz biboumi-e4fcbd3030f033c24102db9f6b6abfb540332c9d.tar.bz2 biboumi-e4fcbd3030f033c24102db9f6b6abfb540332c9d.tar.xz biboumi-e4fcbd3030f033c24102db9f6b6abfb540332c9d.zip |
Add support for password-protected IRC rooms.
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/xmpp_component.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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") { |