Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply to edited message does not take edits into account #1836

Open
f0x52 opened this issue Dec 6, 2024 · 4 comments
Open

Reply to edited message does not take edits into account #1836

f0x52 opened this issue Dec 6, 2024 · 4 comments

Comments

@f0x52
Copy link
Contributor

f0x52 commented Dec 6, 2024

Getting the source text of a replied to event relies on either finding the original message in the eventCache, or failing that, fetching it from the homeserver. In neither of those cases, edits to the message are taken into account.
Relevant code https://github.com/matrix-org/matrix-appservice-irc/blob/develop/src/bridge/MatrixHandler.ts#L1317

When the bridge uses the long reply template, this will always use the old text for the quote

@f0x52
Copy link
Contributor Author

f0x52 commented Dec 6, 2024

Related to edited messages, there's a FIXME comment at https://github.com/matrix-org/matrix-appservice-irc/blob/develop/src/bridge/MatrixHandler.ts#L1086 which can be removed, as since MSC3925 fetching the original event will give you the initial version's content (with later edit events in unsigned['m.relations'])

Before that change, fetching the reply source event from the homeserver would've returned a content.body with edits applied.

@f0x52
Copy link
Contributor Author

f0x52 commented Dec 6, 2024

Also minor issue that for the fetched event, only the raw event.content.body is attempted to be used for the text content. Ideally this would call to MatrixAction.fromEvent() and IrcAction.fromMatrixAction() instead, to get a textual representation of the event's content in a way that's closer to what it would've originally been bridged as, especially around replies to media.

@f0x52
Copy link
Contributor Author

f0x52 commented Dec 6, 2024

In case of an eventCache miss, the fetched original event for an edit should possibly also be stored in the eventCache afterwards, similar to what is done for fetched replies

@funderscore1
Copy link

I think that might be intentional. When someone quotes a message manually edits are usually not taken into account but this is just to restate the context..

But this might be good to have anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants