summaryrefslogtreecommitdiff
path: root/src/xmpp/biboumi_component.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/biboumi_component.cpp')
-rw-r--r--src/xmpp/biboumi_component.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index 37383a8..4996438 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -166,6 +166,8 @@ void BiboumiComponent::handle_message(const Stanza& stanza)
error_type, error_name, "");
});
XmlNode* body = stanza.get_child("body", COMPONENT_NS);
+
+ try { // catch IRCNotConnected exceptions
if (type == "groupchat" && iid.is_channel)
{
if (body && !body->get_inner().empty())
@@ -220,6 +222,13 @@ void BiboumiComponent::handle_message(const Stanza& stanza)
}
else if (iid.is_user)
this->send_invalid_user_error(to.local, from);
+ } catch (const IRCNotConnected& ex)
+ {
+ this->send_stanza_error("message", from, to_str, id,
+ "cancel", "remote-server-not-found",
+ "Not connected to IRC server "s + ex.hostname,
+ true);
+ }
stanza_error.disable();
}
@@ -262,6 +271,7 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
this->send_stanza_error("iq", from, to_str, id,
error_type, error_name, "");
});
+ try {
if (type == "set")
{
XmlNode* query;
@@ -412,6 +422,16 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
}
}
}
+ }
+ catch (const IRCNotConnected& ex)
+ {
+ this->send_stanza_error("iq", from, to_str, id,
+ "cancel", "remote-server-not-found",
+ "Not connected to IRC server "s + ex.hostname,
+ true);
+ stanza_error.disable();
+ return;
+ }
error_type = "cancel";
error_name = "feature-not-implemented";
}