[ADD/FIX/WIP] "Fix" concurrency, prepare XEP-0421

I'll need to break down my commits more...
This commit is contained in:
LDA 2024-07-18 15:50:19 +02:00
commit 63c1bc819e
14 changed files with 356 additions and 162 deletions

View file

@ -148,11 +148,11 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
return false;
}
/* TODO: On semi-anonymous MUCs, it might be preferable to use a
* form of the occupant ID as the base, as it is more unique, and
* less prone to trigger the character limit on Matrix.
*
* See: https://xmpp.org/extensions/xep-0421.html */
if (ServerHasXEP421(args, HashMapGet(stanza->attrs, "from")))
{
}
to = ParseeDecodeMXID(HashMapGet(stanza->attrs, "to"));
decode_from = ParseeLookupJID(from);
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
@ -198,16 +198,9 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
if (mroom_id && !XMPPIsParseeStanza(stanza))
{
char *res = ParseeGetResource(from);
char *encoded = ParseeEncodeJID(args->config, decode_from, false);
char *encoded = ParseeGetBridgedUser(args, stanza);
char *event_id = NULL;
bool chat = false;
if (StrEquals(HashMapGet(stanza->attrs, "type"), "chat"))
{
Free(encoded);
encoded = StrDuplicate(from_matrix);
chat = true;
}
bool chat = StrEquals(HashMapGet(stanza->attrs, "type"), "chat");
{
char *parsee = ParseeJID(args);