mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:15:11 +00:00
[FIX] Fix unfreed value on renames
This commit is contained in:
parent
2324f9afc0
commit
0f3253a385
2 changed files with 11 additions and 7 deletions
|
|
@ -34,7 +34,9 @@ LazyRegister(ParseeData *data, char *mxid, char *name)
|
|||
ASSetName(data->config, mxid, name);
|
||||
if (ref)
|
||||
{
|
||||
HashMapSet(DbJson(ref), "name", JsonValueString(name));
|
||||
JsonValueFree(HashMapSet(
|
||||
DbJson(ref), "name", JsonValueString(name)
|
||||
));
|
||||
}
|
||||
}
|
||||
DbUnlock(data->db, ref);
|
||||
|
|
@ -109,7 +111,8 @@ ProcessChatstates(ParseeData *args, XMLElement *stanza)
|
|||
mroom_id = NULL;
|
||||
from_matrix = NULL;
|
||||
}
|
||||
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES))
|
||||
if (XMLookForTKV(stanza, "paused", "xmlns", CHAT_STATES) ||
|
||||
XMLookForTKV(stanza, "inactive", "xmlns", CHAT_STATES))
|
||||
{
|
||||
char *latest = NULL;
|
||||
from_matrix = ParseeGetBridgedUser(args, stanza);
|
||||
|
|
@ -147,6 +150,7 @@ ProcessChatstates(ParseeData *args, XMLElement *stanza)
|
|||
}
|
||||
#undef CHAT_STATES
|
||||
}
|
||||
|
||||
static float
|
||||
TimeElapsed(uint64_t *rectime, uint64_t v)
|
||||
{
|
||||
|
|
@ -294,9 +298,6 @@ end_error:
|
|||
PEPManagerHandle(thr->info->pep_manager, stanza);
|
||||
Log(LOG_DEBUG, "PEP management: %fs", Elapsed(rectime));
|
||||
|
||||
ProcessChatstates(args, stanza);
|
||||
Log(LOG_DEBUG, "Chatstate management: %fs", Elapsed(rectime));
|
||||
|
||||
to = ParseeDecodeMXID(HashMapGet(stanza->attrs, "to"));
|
||||
decode_from = ParseeLookupJID(from);
|
||||
from_matrix = ParseeEncodeJID(args->config, decode_from, true);
|
||||
|
|
@ -318,7 +319,6 @@ end_error:
|
|||
LazyRegister(args, from_matrix, NULL);
|
||||
room = ASCreateDM(args->config, from_matrix, to);
|
||||
mroom_id = StrDuplicate(room);
|
||||
Log(LOG_DEBUG, "Creating a DM to '%s'(%s)...", to, mroom_id);
|
||||
if (room)
|
||||
{
|
||||
room_ref = DbCreate(args->db, 3, "rooms", room, "data");
|
||||
|
|
@ -403,7 +403,6 @@ end_error:
|
|||
{
|
||||
content = MatrixCreateMedia(mxc, data->data, mime);
|
||||
|
||||
/* Yeah, no, I'm not modifying the media creation code. */
|
||||
HashMapSet(content,
|
||||
"at.kappach.at.parsee.external",
|
||||
JsonValueString(oob_data->data)
|
||||
|
|
@ -539,6 +538,9 @@ end_error:
|
|||
}
|
||||
}
|
||||
|
||||
ProcessChatstates(args, stanza);
|
||||
Log(LOG_DEBUG, "Chatstate management: %fs", Elapsed(rectime));
|
||||
|
||||
end:
|
||||
Free(mroom_id);
|
||||
mroom_id = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue