summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-28 01:27:41 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-28 01:27:41 +0200
commit6c2d03da4ea0443624b6bf434b6a654c12e48438 (patch)
treea1fd150cd3f6c114f1844bed7f57d8ce6438049f /src/bridge
parent7b31bea75b0c5b9fe127ea6d845e48a3f87d480f (diff)
downloadbiboumi-6c2d03da4ea0443624b6bf434b6a654c12e48438.tar.gz
biboumi-6c2d03da4ea0443624b6bf434b6a654c12e48438.tar.bz2
biboumi-6c2d03da4ea0443624b6bf434b6a654c12e48438.tar.xz
biboumi-6c2d03da4ea0443624b6bf434b6a654c12e48438.zip
Send an error presence when the connection to the IRC server fails
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp5
-rw-r--r--src/bridge/bridge.hpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 78cd2d2..70650a5 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -241,6 +241,11 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
this->make_xmpp_body(body), this->user_jid, "chat");
}
+void Bridge::send_join_failed(const Iid& iid, const std::string& nick, const std::string& type, const std::string& condition, const std::string& text)
+{
+ this->xmpp->send_presence_error(iid.chan + "%" + iid.server, nick, this->user_jid, type, condition, text);
+}
+
void Bridge::send_muc_leave(Iid&& iid, std::string&& nick, const std::string& message, const bool self)
{
this->xmpp->send_muc_leave(std::move(iid.chan) + "%" + std::move(iid.server), std::move(nick), this->make_xmpp_body(message), this->user_jid, self);
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index 37f5b05..2618ca6 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -81,6 +81,11 @@ public:
*/
void send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc);
/**
+ * Send a presence of type error, from a room. This is used to indicate
+ * why joining a room failed.
+ */
+ void send_join_failed(const Iid& iid, const std::string& nick, const std::string& type, const std::string& condition, const std::string& text);
+ /**
* Send an unavailable presence from this participant
*/
void send_muc_leave(Iid&& iid, std::string&& nick, const std::string& message, const bool self);