Save all edit events internally #94

Open
opened 2025-10-14 15:38:59 -06:00 by navan · 0 comments
Owner

Originally created by @VAWVAW on 6/4/2025

This saves replacement/edit events in two places:

  1. In RoomInfo::message with a new message type.
    This is needed for read receipts on edits and redaction of edits to work.
  2. In Message::event for MessageEvent::Original and MessageEvent::Local (though I'm not sure whether a local event could get edited).
    This allows every access to the message body to be replaced by an access to the newest edit.
    If an edit is redacted, it is simply removed from this list.

In case the edit event is loaded before the message itself, it is saved to RoomInfo::unloaded_edits.

possible future additions

  • The function msg_not_hidden in src/windows/room/scrollback.rs is used to hide the edit events from the timeline and could be extended to hide other kinds of events.
  • The edit history could be exposed to the user with a command like :edits, making it possible to view and redact edit events.

fixes #431

*Originally created by @VAWVAW on 6/4/2025* This saves replacement/edit events in two places: 1. In `RoomInfo::message` with a new message type. This is needed for read receipts on edits and redaction of edits to work. 2. In `Message::event` for `MessageEvent::Original` and `MessageEvent::Local` (though I'm not sure whether a local event could get edited). This allows every access to the message body to be replaced by an access to the newest edit. If an edit is redacted, it is simply removed from this list. In case the edit event is loaded before the message itself, it is saved to `RoomInfo::unloaded_edits`. ## possible future additions - The function `msg_not_hidden` in `src/windows/room/scrollback.rs` is used to hide the edit events from the timeline and could be extended to hide other kinds of events. - The edit history could be exposed to the user with a command like `:edits`, making it possible to view and redact edit events. fixes #431
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/iamb#94
No description provided.