mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 07:25:05 -04:00
Recursively fetch the thread for receipts & notifications. (#13824)
Consider an event to be part of a thread if you can follow a chain of relations up to a thread root. Part of MSC3773 & MSC3771.
This commit is contained in:
parent
3e74ad20db
commit
2b6d41ebd6
5 changed files with 162 additions and 2 deletions
|
@ -286,8 +286,13 @@ class BulkPushRuleEvaluator:
|
|||
relation.parent_id,
|
||||
itertools.chain(*(r.rules() for r in rules_by_user.values())),
|
||||
)
|
||||
# Recursively attempt to find the thread this event relates to.
|
||||
if relation.rel_type == RelationTypes.THREAD:
|
||||
thread_id = relation.parent_id
|
||||
else:
|
||||
# Since the event has not yet been persisted we check whether
|
||||
# the parent is part of a thread.
|
||||
thread_id = await self.store.get_thread_id(relation.parent_id) or "main"
|
||||
|
||||
evaluator = PushRuleEvaluator(
|
||||
_flatten_dict(event),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue