mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 12:42:10 -04:00
Implement push rule evaluation in Rust. (#13838)
This commit is contained in:
parent
a466164647
commit
ebd9e2dac6
14 changed files with 894 additions and 403 deletions
|
@ -1,4 +1,4 @@
|
|||
from typing import Any, Collection, Dict, Mapping, Sequence, Tuple, Union
|
||||
from typing import Any, Collection, Dict, Mapping, Optional, Sequence, Set, Tuple, Union
|
||||
|
||||
from synapse.types import JsonDict
|
||||
|
||||
|
@ -35,3 +35,20 @@ class FilteredPushRules:
|
|||
def rules(self) -> Collection[Tuple[PushRule, bool]]: ...
|
||||
|
||||
def get_base_rule_ids() -> Collection[str]: ...
|
||||
|
||||
class PushRuleEvaluator:
|
||||
def __init__(
|
||||
self,
|
||||
flattened_keys: Mapping[str, str],
|
||||
room_member_count: int,
|
||||
sender_power_level: Optional[int],
|
||||
notification_power_levels: Mapping[str, int],
|
||||
relations: Mapping[str, Set[Tuple[str, str]]],
|
||||
relation_match_enabled: bool,
|
||||
): ...
|
||||
def run(
|
||||
self,
|
||||
push_rules: FilteredPushRules,
|
||||
user_id: Optional[str],
|
||||
display_name: Optional[str],
|
||||
) -> Collection[dict]: ...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue