Skip to content

Properly generate mentions when editing a reply with MSC3952 #24924

@clokep

Description

@clokep

As part of #24377 initial support for MSC3952 was implemented in #9983. That implementation has a couple of bugs/deficiencies to fix-up around editing messages. (The below all assume you have MSC3952 support enabled.)


MSC3952 states that clients may wish to include the user being replied to in the mentions array; this is handled properly for normal messages, content messages, voice messages, and command messages. It is not handled properly when editing a message which is a reply. 1

The result of this is that the user being replied to gets dropped from the mentions array after the edit, which is incorrect. Note that the top-level mentions object only includes newly (in that edit) mentioned people (which the replied person will not be), but the one under m.new_content should include all the users being replied to.

I think all that is necessary is fetching the replied-to MatrixEvent and passing it into attachMentions, but it might need further testing.

Footnotes

  1. As an aside it looks like the editing code also double-checks the SettingsStore to ensure intentional mentions are enabled. This was probably left-over from refactoring and we should remove it when updating this logic to properly handle replies.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions