[MOD] Verbosity levels, avatar cleanser

I have a weird bug where Parsee seems to hang on a Db request, been
tryign to figure that otu since a while but can't quite put my finger on
where.
You can have this commit, as a treat.
This commit is contained in:
LDA 2024-08-24 19:36:37 +02:00
commit 692cb8aa6f
19 changed files with 190 additions and 111 deletions

View file

@ -120,7 +120,6 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
{
XMLElement *vcard = XMLookForTKV(stanza, "vCard", "xmlns", "vcard-temp");
/* TODO: Move this to PEP */
XMLElement *event = XMLookForTKV(stanza, "pubsub",
"xmlns", "http://jabber.org/protocol/pubsub"
@ -169,12 +168,16 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
DbUnlock(args->db, avatars);
return;
}
JsonValueFree(JsonSet(
json, JsonValueString(id),
1, from
));
DbUnlock(args->db, avatars);
base64 = TrimBase64(data->data);
b64len = base64 ? strlen(base64) : 0;
length = Base64DecodedSize(base64, b64len);
/* TODO: Bound checks for a size limit. */
bdata = (char *) Base64Decode(base64, b64len);
datastream = StrStreamReaderN(bdata, length);
@ -185,12 +188,6 @@ IQResult(ParseeData *args, XMLElement *stanza, XMPPThread *thr)
from_matrix = ParseeGetBridgedUser(args, stanza);
ASSetAvatar(args->config, from_matrix, mxc);
JsonValueFree(JsonSet(
json, JsonValueString(id),
1, from
));
DbUnlock(args->db, avatars);
Free(mxc);
Free(jid);
Free(bdata);