This repository was archived by the owner on Jan 22, 2026. It is now read-only.
Support editing/removing multipart Slack messages#782
Open
tadzik wants to merge 9 commits intomatrix-org:developfrom
Open
Support editing/removing multipart Slack messages#782tadzik wants to merge 9 commits intomatrix-org:developfrom
tadzik wants to merge 9 commits intomatrix-org:developfrom
Conversation
This makes us the original sender's intent to redact messages, so that we do not require an elevated PL to handle message deletion.
…rmine a more fitting user
We may produce multiple Matrix events per Slack events, if the Slack events contains text with attachments. This should have been forbidden with a DB constraint, but for some reason it happened regardless. This updates the constraint to match reality, differentiating Matrix events by the type of incoming Slack event. For backwards compatibility reasons getEventBySlackId() returns the "main" Matrix event.
…zik/one-to-many-events
Messages with a message_changed will have the same `ts` as the original message, but a different `event_ts`. We now check both when considering whether or not to drop a message, and log our reasons regardless.
We now track which attachments was linked to which Matrix message, and support both removing them individually and dropping the whole event "tree".
Half-Shot
suggested changes
Jun 5, 2024
Contributor
Half-Shot
left a comment
There was a problem hiding this comment.
Looks okay, could do with a test?
Contributor
Author
|
Note: this is RTM-only, as webhooks do not support multipart messages in the first place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We may produce multiple Matrix events per Slack events, if the Slack events contains text with attachments. This should have been forbidden with a DB constraint, but for some reason it happened regardless.
This updates the constraint to match reality, differentiating Matrix events by the type of incoming Slack event. For backwards compatibility reasons getEventBySlackId() returns the "main" Matrix event.
When handling message changes and message deletion, we will now correctly edit the right part of the message – either changing the text or removing some of the attachments (fixes #486). Deleting the whole message will now also remove all the attachments associated with it.
Depends on #780
Does not support NeDB, but I wonder if we want to support NeDB at all these days (ref #775)