Commit f0ad4f5
authored
Fix message forwarding by removing relation to avoid issues (#558)
### Description
This pull request fixes an issue with forwarding messages for users on
Synapse homeservers by ensuring that relations and mentions are properly
removed from forwarded messages. The changes focus on improving privacy
and preventing confusion when messages are forwarded to other rooms.
#### Forwarding and privacy improvements
- Removed the `m.relates_to` and `m.mentions` fields from the forwarded
message content to avoid leaking relations or mentions from the original
message.
- Removed the addition of a new `m.relates_to` relation when
constructing the forwarded message, preventing references to the
original event in the forwarded message.
Fixes #539
#### Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
### Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
### AI disclosure:
- [ ] Partially AI assisted (clarify which code was AI assisted and
briefly explain what it does).
- [ ] Fully AI generated (explain what all the generated code does in
moderate detail).
<!-- Write any explanation required here, but do not generate the
explanation using AI!! You must prove you understand what the code in
this PR does. -->
no AI was used in the creation of this PR2 files changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| |||
232 | 234 | | |
233 | 235 | | |
234 | 236 | | |
235 | | - | |
236 | | - | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 252 | | |
257 | 253 | | |
258 | 254 | | |
| |||
0 commit comments