summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-07-08 18:10:47 +0200
committerlouiz’ <louiz@louiz.org>2017-07-08 18:10:47 +0200
commit9fa1852c7ea094086f45e840fa22cc83d56b744e (patch)
tree9d6d628f6403f3cb375206d406ff869c015c3eaf /src/xmpp
parent3a95076db40dbdff4b130c5d9b8db81e537a750d (diff)
downloadbiboumi-9fa1852c7ea094086f45e840fa22cc83d56b744e.tar.gz
biboumi-9fa1852c7ea094086f45e840fa22cc83d56b744e.tar.bz2
biboumi-9fa1852c7ea094086f45e840fa22cc83d56b744e.tar.xz
biboumi-9fa1852c7ea094086f45e840fa22cc83d56b744e.zip
Send status code='332' on biboumi or IRC server’s shutdown
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/xmpp_component.cpp8
-rw-r--r--src/xmpp/xmpp_component.hpp7
2 files changed, 13 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 3c69b36..7366422 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -441,7 +441,8 @@ void XmppComponent::send_history_message(const std::string& muc_name, const std:
this->send_stanza(message);
}
-void XmppComponent::send_muc_leave(const std::string& muc_name, const std::string& nick, Xmpp::body&& message, const std::string& jid_to, const bool self)
+void XmppComponent::send_muc_leave(const std::string& muc_name, const std::string& nick, Xmpp::body&& message,
+ const std::string& jid_to, const bool self, const bool user_requested)
{
Stanza presence("presence");
{
@@ -456,6 +457,11 @@ void XmppComponent::send_muc_leave(const std::string& muc_name, const std::strin
XmlSubNode status(x, "status");
status["code"] = "110";
}
+ if (!user_requested)
+ {
+ XmlSubNode status(x, "status");
+ status["code"] = "332";
+ }
if (!message_str.empty())
{
XmlSubNode status(presence, "status");
diff --git a/src/xmpp/xmpp_component.hpp b/src/xmpp/xmpp_component.hpp
index ebe3ec8..f4a7655 100644
--- a/src/xmpp/xmpp_component.hpp
+++ b/src/xmpp/xmpp_component.hpp
@@ -146,7 +146,12 @@ public:
/**
* Send an unavailable presence for this nick
*/
- void send_muc_leave(const std::string& muc_name, const std::string& nick, Xmpp::body&& message, const std::string& jid_to, const bool self);
+ void send_muc_leave(const std::string& muc_name,
+ const std::string& nick,
+ Xmpp::body&& message,
+ const std::string& jid_to,
+ const bool self,
+ const bool user_requested);
/**
* Indicate that a participant changed his nick
*/