[ADD/WIP] Editing support XMPP->Matrix

This commit is contained in:
LDA 2024-06-25 17:20:00 +02:00
commit ae740878c8
13 changed files with 249 additions and 106 deletions

View file

@ -199,3 +199,38 @@ XMPPIsParseeStanza(XMLElement *stanza)
return !!XMLookForUnique(stanza, "x-parsee");
}
char *
XMPPGetStanzaID(XMLElement *stanza)
{
XMLElement *stanza_id;
if (!stanza)
{
return NULL;
}
stanza_id = XMLookForTKV(stanza, "stanza-id", "xmlns", "urn:xmpp:sid:0");
return stanza_id ? HashMapGet(stanza_id->attrs, "id") : NULL;
}
char *
XMPPGetOriginID(XMLElement *stanza)
{
XMLElement *origin_id;
if (!stanza)
{
return NULL;
}
origin_id = XMLookForTKV(stanza, "origin-id", "xmlns", "urn:xmpp:sid:0");
return origin_id ? HashMapGet(origin_id->attrs, "id") : NULL;
}
char *
XMPPGetReplacedID(XMLElement *stanza)
{
XMLElement *replace = XMLookForTKV(
stanza, "replace",
"xmlns", "urn:xmpp:message-correct:0"
);
return replace ? HashMapGet(replace->attrs, "id") : NULL;
}