[MOD/WIP] Continue XEP-0421

This commit is contained in:
LDA 2024-07-19 17:07:13 +02:00
commit c9f8d69802
8 changed files with 120 additions and 66 deletions

View file

@ -180,7 +180,7 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
mxc = ASUpload(args->config, datastream, length, "image/png");
jid = ParseeLookupJID(from);
from_matrix = ParseeEncodeJID(args->config, jid, false);
from_matrix = ParseeGetBridgedUser(args, stanza);
ASSetAvatar(args->config, from_matrix, mxc);
JsonValueFree(JsonSet(

View file

@ -148,11 +148,6 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
return false;
}
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);

View file

@ -76,8 +76,7 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
char *from = NULL;
char *type = HashMapGet(stanza->attrs, "type");
char *room = ParseeGetBridgedRoom(args, stanza);
char *decode_from = ParseeLookupJID(oid);
char *real_matrix = ParseeDecodeMXID(decode_from);
char *decode_from, *real_matrix;
char *matrix_user_pl = ParseeEncodeJID(args->config, trim, false);
char *affiliation = HashMapGet(item->attrs, "affiliation");
int power_level = 0;
@ -85,10 +84,18 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
Free(trim);
if (jid)
{
ParseePushJIDTable(oid, jid);
}
decode_from = ParseeLookupJID(oid);
real_matrix = ParseeDecodeMXID(decode_from);
if (!real_matrix || *real_matrix != '@')
{
Free(real_matrix);
real_matrix = ParseeEncodeJID(args->config, decode_from, false);
/*real_matrix = ParseeEncodeJID(args->config, decode_from, false);*/
real_matrix = ParseeGetBridgedUserI(args, stanza, oid);
}
if (StrEquals(affiliation, "owner"))
@ -163,10 +170,6 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
}
}
if (jid)
{
ParseePushJIDTable(oid, jid);
}
Free(from);
Free(decode_from);
@ -179,8 +182,7 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
{
XMLElement *status_data = ArrayGet(status->children, 0);
char *decode_from = ParseeLookupJID(oid);
char *trimmed = ParseeTrimJID(decode_from);
char *from_matrix = ParseeEncodeJID(args->config, trimmed, false);
char *from_matrix = ParseeGetBridgedUser(args, stanza);
char *status_str = NULL;
if (status_data)
{
@ -199,7 +201,6 @@ PresenceStanza(ParseeData *args, XMLElement *stanza)
Free(decode_from);
Free(from_matrix);
Free(trimmed);
}
if (vc)
{