summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-01-24 16:19:13 +0100
committerFlorent Le Coz <louiz@louiz.org>2015-01-24 17:33:04 +0100
commit2c5d3d89b0eb1e6b8d888b4d37ceca6f23c2e314 (patch)
tree458c2e5c387cbcafee16017c323a7f50557f7db1 /src/xmpp/xmpp_component.cpp
parenta447214f10e894a7de827c3ff10c185280ed2538 (diff)
downloadbiboumi-2c5d3d89b0eb1e6b8d888b4d37ceca6f23c2e314.tar.gz
biboumi-2c5d3d89b0eb1e6b8d888b4d37ceca6f23c2e314.tar.bz2
biboumi-2c5d3d89b0eb1e6b8d888b4d37ceca6f23c2e314.tar.xz
biboumi-2c5d3d89b0eb1e6b8d888b4d37ceca6f23c2e314.zip
Change IRC modes when receiving an affiliation/role change request
fix #2946
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index c63dc00..0328c78 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -481,14 +481,20 @@ void XmppComponent::handle_iq(const Stanza& stanza)
{
std::string nick = child->get_tag("nick");
std::string role = child->get_tag("role");
- if (!nick.empty() && role == "none")
- { // This is a kick
- std::string reason;
- XmlNode* reason_el = child->get_child("reason", MUC_ADMIN_NS);
- if (reason_el)
- reason = reason_el->get_inner();
+ std::string affiliation = child->get_tag("affiliation");
+ if (!nick.empty())
+ {
Iid iid(to.local);
- bridge->send_irc_kick(iid, nick, reason, id, from);
+ if (role == "none")
+ { // This is a kick
+ std::string reason;
+ XmlNode* reason_el = child->get_child("reason", MUC_ADMIN_NS);
+ if (reason_el)
+ reason = reason_el->get_inner();
+ bridge->send_irc_kick(iid, nick, reason, id, from);
+ }
+ else
+ bridge->forward_affiliation_role_change(iid, nick, affiliation, role);
stanza_error.disable();
}
}