From 5d268a71a50890fbd5010aae0945fff58b91f7e2 Mon Sep 17 00:00:00 2001 From: LDA Date: Sun, 8 Sep 2024 09:11:58 +0200 Subject: [PATCH] [FIX] Fix out edits --- src/XMPPThread/Stanzas/Message.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/XMPPThread/Stanzas/Message.c b/src/XMPPThread/Stanzas/Message.c index 6516509..187382a 100644 --- a/src/XMPPThread/Stanzas/Message.c +++ b/src/XMPPThread/Stanzas/Message.c @@ -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