mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[ADD/WIP] Make basic XMPP->Matrix redactions
I'll need to use the actual redaction endpoint eventually, hence the WIP status.
This commit is contained in:
parent
517622a4ac
commit
a167d5d724
3 changed files with 47 additions and 2 deletions
|
|
@ -290,6 +290,34 @@ XMPPGetReplacedID(XMLElement *stanza)
|
|||
return replace ? HashMapGet(replace->attrs, "id") : NULL;
|
||||
}
|
||||
char *
|
||||
XMPPGetRetractedID(XMLElement *stanza)
|
||||
{
|
||||
XMLElement *retract = XMLookForTKV(
|
||||
stanza, "retract",
|
||||
"xmlns", "urn:xmpp:message-retract:1"
|
||||
);
|
||||
char *id = retract ? HashMapGet(retract->attrs, "id") : NULL;
|
||||
if (!id)
|
||||
{
|
||||
/* Pretend its fastened */
|
||||
XMLElement *fasten = XMLookForTKV(
|
||||
stanza, "apply-to",
|
||||
"xmlns", "urn:xmpp:fasten:0"
|
||||
);
|
||||
retract = XMLookForTKV(
|
||||
fasten, "retract",
|
||||
"xmlns", "urn:xmpp:message-retract:0"
|
||||
);
|
||||
|
||||
if (retract)
|
||||
{
|
||||
id = HashMapGet(fasten->attrs, "id");
|
||||
}
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
char *
|
||||
XMPPGetReply(XMLElement *elem)
|
||||
{
|
||||
XMLElement *rep = XMLookForTKV(elem, "reply", "xmlns", "urn:xmpp:reply:0");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue