Allow disco queries with a node (needed for CAPS)
This commit is contained in:
@@ -536,10 +536,10 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
|
|||||||
const std::string node = query->get_tag("node");
|
const std::string node = query->get_tag("node");
|
||||||
if (to_str == this->served_hostname)
|
if (to_str == this->served_hostname)
|
||||||
{
|
{
|
||||||
if (node.empty())
|
if (node.empty() || node.rfind("https://biboumi.louiz.org/#", 0) == 0)
|
||||||
{
|
{
|
||||||
// On the gateway itself
|
// On the gateway itself
|
||||||
this->send_self_disco_info(id, from);
|
this->send_self_disco_info(id, from, node);
|
||||||
stanza_error.disable();
|
stanza_error.disable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -943,12 +943,13 @@ std::vector<Bridge*> BiboumiComponent::get_bridges() const
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BiboumiComponent::send_self_disco_info(const std::string& id, const std::string& jid_to)
|
void BiboumiComponent::send_self_disco_info(const std::string& id, const std::string& jid_to, const std::string& node)
|
||||||
{
|
{
|
||||||
Stanza iq("iq");
|
Stanza iq("iq");
|
||||||
{
|
{
|
||||||
iq["type"] = "result";
|
iq["type"] = "result";
|
||||||
iq["id"] = id;
|
iq["id"] = id;
|
||||||
|
if (!node.empty()) iq["node"] = node;
|
||||||
iq["to"] = jid_to;
|
iq["to"] = jid_to;
|
||||||
iq["from"] = this->served_hostname;
|
iq["from"] = this->served_hostname;
|
||||||
XmlSubNode query(iq, "query");
|
XmlSubNode query(iq, "query");
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Send a result IQ with the gateway disco informations.
|
* Send a result IQ with the gateway disco informations.
|
||||||
*/
|
*/
|
||||||
void send_self_disco_info(const std::string& id, const std::string& jid_to);
|
void send_self_disco_info(const std::string& id, const std::string& jid_to, const std::string& node);
|
||||||
/**
|
/**
|
||||||
* Send a result IQ with the disco informations regarding IRC server JIDs.
|
* Send a result IQ with the disco informations regarding IRC server JIDs.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user