mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[ADD/FIX] XMPP->Matrix mod, fix PL issue
This commit is contained in:
parent
3c26ee6d22
commit
e7c44a05e2
7 changed files with 106 additions and 21 deletions
|
|
@ -416,3 +416,39 @@ XMPPAnnotatePresence(XMLElement *presence)
|
|||
Free(ver);
|
||||
XMLAddChild(presence, c);
|
||||
}
|
||||
|
||||
char *
|
||||
XMPPGetModeration(XMLElement *stanza)
|
||||
{
|
||||
#define MOD_BASE "urn:xmpp:message-moderate"
|
||||
XMLElement *moderate;
|
||||
XMLElement *fasten;
|
||||
if (!stanza)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 0.3.0 version of XEP-0425: Bare look at the moderate element */
|
||||
moderate = XMLookForTKV(stanza, "moderate", "xmlns", MOD_BASE ":1");
|
||||
if (moderate)
|
||||
{
|
||||
Log(LOG_WARNING, "0.3.0 moderation");
|
||||
return HashMapGet(moderate->attrs, "id");
|
||||
}
|
||||
|
||||
/* Earlier versions, which still depend on fastening. */
|
||||
fasten = XMLookForTKV(
|
||||
stanza, "apply-to",
|
||||
"xmlns", "urn:xmpp:fasten:0"
|
||||
);
|
||||
moderate = XMLookForTKV(
|
||||
fasten, "moderated",
|
||||
"xmlns", MOD_BASE ":0"
|
||||
);
|
||||
if (moderate)
|
||||
{
|
||||
return HashMapGet(fasten->attrs, "id");
|
||||
}
|
||||
return NULL;
|
||||
#undef MOD_BASE
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue