matrix-hacks / matrix-puppet-slack

puppet style slack bridge for matrix
47 stars 17 forks source link

Message edits where the contents are the same post-edit should be ignored #64

Closed Cadair closed 5 years ago

Cadair commented 5 years ago

This is mainly noticeable when you send a link, as slack sends another edit message back with extra metadata about the link, the result is that you get an edit message showing up in Matrix with the same contents.

This is done in matrix-appservice-slack here: https://github.com/matrix-org/matrix-appservice-slack/blob/master/lib/BridgedRoom.js#L270

thomas-profitt commented 5 years ago

Thanks for the issue! I had stopped noticing this, so I'm glad you took the time to create an issue.

I don't remember what the data structure Slack sends us looks like, but we be interpreting "URL preview" messages as edits, or we may be treating edits not changing text but adding URL previews just like real edits, so we might be able to tell whether a message is a real edit or not without having to handle any state to compare message contents, like converting it to handle "Slackdown", getting the converted Matrix event's body, and then comparing them before creating a Matrix event.

We definitely shouldn't post Matrix messages for Slack edits when the text hasn't changed, and there may be a way to handle the problem without working with so much state.