Add option to exclude specific rooms from a rule

This commit is contained in:
Tulir Asokan 2019-07-31 19:28:15 +03:00
parent 50141c8a92
commit 217351d141
2 changed files with 4 additions and 0 deletions

View file

@ -53,6 +53,7 @@ class Config(BaseProxyConfig):
def _make_rule(self, name: str, rule: Dict[str, Any]) -> Rule:
try:
return Rule(rooms=set(rule.get("rooms", [])),
not_rooms=set(rule.get("not_rooms", [])),
matches=self._compile_all(rule["matches"]),
not_matches=self._compile_all(rule.get("not_matches", [])),
type=EventType.find(rule["type"]) if "type" in rule else None,