mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 20:49:05 -04:00
In https://github.com/matrix-org/matrix-rust-sdk/pull/2691, I suppose the way `add_mentions` is computed is… wrong. `AddMentions` is used to automatically infer the `m.mentions` of the reply event based on the replied event. The way it was computed was based on the reply event `mentions`, which seems wrong: if the reply contains mentions, then the sender should be part of it? Nah. That's a bug. We want the reply event to automatically mention the sender of the replied event if and only if it's not the same as the current user, i.e. the sender of the reply event. This patch fixes the `add_mentions` calculation. This patch also updates a test and adds another test to ensure that `m.mentions` is correctly defined when replying to an event.