Allow disco queries with a node (needed for CAPS)

This commit is contained in:
Stephen Paul Weber
2026-08-02 18:13:39 +02:00
committed by Luca Matei Pintilie
parent a9dae0621a
commit 567b139e1c
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -545,10 +545,10 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
const std::string node = query->get_tag("node");
if (to_str == this->served_hostname)
{
if (node.empty())
if (node.empty() || node.rfind("https://biboumi.louiz.org/#", 0) == 0)
{
// On the gateway itself
this->send_self_disco_info(id, from);
this->send_self_disco_info(id, from, node);
stanza_error.disable();
}
}
@@ -952,12 +952,13 @@ std::vector<Bridge*> BiboumiComponent::get_bridges() const
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");
{
iq["type"] = "result";
iq["id"] = id;
if (!node.empty()) iq["node"] = node;
iq["to"] = jid_to;
iq["from"] = this->served_hostname;
XmlSubNode query(iq, "query");
@@ -1213,7 +1214,7 @@ void BiboumiComponent::send_presence_to_contact(const std::string& from, const s
c["xmlns"] = CAPS_NS;
c["hash"] = "sha-1";
c["node"] = "https://biboumi.louiz.org/";
c["ver"] = "m8CzZQt9wVuZlrV5a/vZYk/zAN0=";
c["ver"] = "URGCt+50NTdI6Ifcm1/YYNVxSjc=";
}
this->send_stanza(presence);
}
+1 -1
View File
@@ -63,7 +63,7 @@ public:
/**
* 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.
*/