Add gateway/irc and caps

This commit is contained in:
Stephen Paul Weber
2022-03-07 22:41:44 -05:00
parent f14752b06f
commit e0c50dd99a
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -953,11 +953,15 @@ void BiboumiComponent::send_self_disco_info(const std::string& id, const std::st
iq["from"] = this->served_hostname;
XmlSubNode query(iq, "query");
query["xmlns"] = DISCO_INFO_NS;
XmlSubNode gwid(query, "identity");
gwid["category"] = "gateway";
gwid["type"] = "irc";
gwid["name"] = "Biboumi";
XmlSubNode identity(query, "identity");
identity["category"] = "conference";
identity["type"] = "irc";
identity["name"] = "Biboumi XMPP-IRC gateway";
for (const char *ns: {DISCO_INFO_NS, MUC_NS, ADHOC_NS, PING_NS, MAM_NS, VERSION_NS, STABLE_MUC_ID_NS})
for (const char *ns: {DISCO_INFO_NS, CAPS_NS, MUC_NS, ADHOC_NS, PING_NS, MAM_NS, VERSION_NS, STABLE_MUC_ID_NS})
{
XmlSubNode feature(query, "feature");
feature["var"] = ns;
@@ -1194,6 +1198,14 @@ void BiboumiComponent::send_presence_to_contact(const std::string& from, const s
presence["type"] = type;
if (!id.empty())
presence["id"] = id;
if (type.empty() && from == this->served_hostname) {
XmlSubNode c(presence, "c");
c["xmlns"] = CAPS_NS;
c["hash"] = "sha-1";
c["node"] = "https://biboumi.louiz.org/";
c["ver"] = "m8CzZQt9wVuZlrV5a/vZYk/zAN0=";
}
this->send_stanza(presence);
}