Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Optimize private read receipt filtering #12711

Merged
21 changes: 21 additions & 0 deletions tests/handlers/test_receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,27 @@ def test_leaves_our_private_and_their_public(self):
],
)

def test_we_do_not_mutate(self):
events = [
{
"content": {
"$1435641916114394fHBLK:matrix.org": {
ReceiptTypes.READ_PRIVATE: {
"@rikj:jki.re": {
"ts": 1436451550453,
}
}
}
},
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"type": "m.receipt",
}
]
events_copy = events.copy()
SimonBrandner marked this conversation as resolved.
Show resolved Hide resolved

self.event_source.filter_out_private(events, "@me:server.org")
self.assertEqual(events, events_copy)

def _test_filters_private(
self, events: List[JsonDict], expected_output: List[JsonDict]
):
Expand Down