mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:45:01 -04:00
Avoid unnecessary copies when filtering private read receipts. (#12711)
A minor optimization to avoid unnecessary copying/building identical dictionaries when filtering private read receipts. Also clarifies comments and cleans-up some tests.
This commit is contained in:
parent
b4eb163434
commit
3ce15cc7be
4 changed files with 89 additions and 70 deletions
|
@ -143,7 +143,7 @@ class InitialSyncHandler:
|
|||
to_key=int(now_token.receipt_key),
|
||||
)
|
||||
if self.hs.config.experimental.msc2285_enabled:
|
||||
receipt = ReceiptEventSource.filter_out_private(receipt, user_id)
|
||||
receipt = ReceiptEventSource.filter_out_private_receipts(receipt, user_id)
|
||||
|
||||
tags_by_room = await self.store.get_tags_for_user(user_id)
|
||||
|
||||
|
@ -449,7 +449,9 @@ class InitialSyncHandler:
|
|||
if not receipts:
|
||||
return []
|
||||
if self.hs.config.experimental.msc2285_enabled:
|
||||
receipts = ReceiptEventSource.filter_out_private(receipts, user_id)
|
||||
receipts = ReceiptEventSource.filter_out_private_receipts(
|
||||
receipts, user_id
|
||||
)
|
||||
return receipts
|
||||
|
||||
presence, receipts, (messages, token) = await make_deferred_yieldable(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue