summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-05-11 05:03:09 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-05-11 05:03:09 +0200
commitad5bd99618fd4f1ee92d48d90912d627187aaa11 (patch)
treef9cd43ec45486ce85fc490e02e82a1f65b0c8b63
parent5475d16b574e1daf9c1e5f94b5b821bfb1b9c8f8 (diff)
downloadbiboumi-ad5bd99618fd4f1ee92d48d90912d627187aaa11.tar.gz
biboumi-ad5bd99618fd4f1ee92d48d90912d627187aaa11.tar.bz2
biboumi-ad5bd99618fd4f1ee92d48d90912d627187aaa11.tar.xz
biboumi-ad5bd99618fd4f1ee92d48d90912d627187aaa11.zip
Properly send error response on presence stanzas
-rw-r--r--src/xmpp/biboumi_component.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index 4996438..5d571ec 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -116,6 +116,7 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
error_type, error_name, "");
});
+ try {
if (iid.is_channel && !iid.get_server().empty())
{ // presence toward a MUC that corresponds to an irc channel, or a
// dummy channel if iid.chan is empty
@@ -141,6 +142,14 @@ void BiboumiComponent::handle_presence(const Stanza& stanza)
if (type.empty())
this->send_invalid_room_error(to.local, to.resource, from);
}
+ }
+ catch (const IRCNotConnected& ex)
+ {
+ this->send_stanza_error("presence", from, to_str, id,
+ "cancel", "remote-server-not-found",
+ "Not connected to IRC server "s + ex.hostname,
+ true);
+ }
stanza_error.disable();
}