[FIX] Fix out edits

This commit is contained in:
LDA 2024-09-08 09:11:58 +02:00
commit 5d268a71a5

View file

@ -192,7 +192,7 @@ end_error:
/* TODO: CLEAN THAT UP INTO A CREATEDM FUNCTION */
mroom_id = ParseeGetBridgedRoom(args, stanza);
Log(LOG_DEBUG, "Bridging to '%s'", mroom_id);
Log(LOG_DEBUG, "Bridging event to '%s'...", mroom_id);
if (!mroom_id && !room && !XMPPIsParseeStanza(stanza) &&
to && *to == '@')
{
@ -203,7 +203,7 @@ end_error:
ASRegisterUser(args->config, from_matrix);
room = ASCreateDM(args->config, from_matrix, to);
mroom_id = StrDuplicate(room);
Log(LOG_INFO, "Creating a DM to '%s'(%s)", to, mroom_id);
Log(LOG_INFO, "Creating a DM to '%s'(%s)...", to, mroom_id);
if (room)
{
room_ref = DbCreate(args->db, 3, "rooms", room, "data");
@ -394,18 +394,13 @@ end_error:
* that objectifies a stanza. */
size_t off =
reply_to ? ParseeFindDatastart(data->data) : 0;
event_id = ParseeGetEventFromID(args, stanza, replaced);
HashMap *ev = ShoveStanza(
MatrixCreateReplace(event_id, data->data + off),
stanza
);
if (reply_to)
{
char *reply_id =
ParseeGetEventFromID(args, stanza, reply_to);
MatrixSetReply(ev, reply_id);
Free(reply_id);
}
event_id = ParseeGetEventFromID(args, stanza, replaced);
Log(LOG_DEBUG, "Replacing events in %s(%s)", mroom_id, event_id);
Free(ASSend(
args->config, mroom_id, encoded,
"m.room.message", ev