Recalculate mentions metadata of forwarded messages based on message body#31193
Conversation
In transformEvent(), parse event body back into an EditorModel, and pass this into attachMentions(), so that it actually recalculates mentions.
Refactor test for stripping mentions on forwards to allow for more tests of mention recalculation
Fails due to not mocking room membership
|
Tests are pending me figuring out how to correctly mock room membership. In the not-unlikely event that someone knows how to do this, assistance would be welcome. |
Hi sorry for the delay! You can use element-web/test/test-utils/test-utils.ts Line 473 in e97de7d Or you can also mock the membership of the room with: |
|
Thank you! I'll take a look and see if I can implement this. |
|
Apparently all that was necessary was to mock the source room. This should be sufficient? |
|
@twassman can you update the PR title to something helpful in a changelog, |
|
@t3chguy: Better? |
|
Not really? What user impact does this have? |
|
Ostensibly that the correct set of users would get mentioned when receiving such forwarded messages. I'm not sure exactly what would be preferable for title phrasing. |
|
If the PR title is the main issue here, then it would be appreciated if a more suitable title could be provided by someone with a better understanding of what is desired. As this issue most directly deals only with metadata recalculation, I don't know how to phrase this in a more end-user-understandable manner. |
In
transformEvent(), parse event body back into anEditorModel, and pass this intoattachMentions(), so that it actually recalculates mentions based on the message body.Follow up to #30884.
Checklist
public/exportedsymbols have accurate TSDoc documentation.