diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-09-20 07:48:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 07:48:55 -0400 |
commit | 7ec0a141b4bdda0fa67cb1f2af7f321b9963f0b8 (patch) | |
tree | 8a500d3fce31d337d50d43c75df70d243371acb2 /synapse/api | |
parent | Return immutable objects for cachedList decorators (#16350) (diff) | |
download | synapse-7ec0a141b4bdda0fa67cb1f2af7f321b9963f0b8.tar.xz |
Convert more cached return values to immutable types (#16356)
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/filtering.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index 0995ecbe83..74ee8e9f3f 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -37,7 +37,7 @@ from synapse.api.constants import EduTypes, EventContentFields from synapse.api.errors import SynapseError from synapse.api.presence import UserPresenceState from synapse.events import EventBase, relation_from_event -from synapse.types import JsonDict, RoomID, UserID +from synapse.types import JsonDict, JsonMapping, RoomID, UserID if TYPE_CHECKING: from synapse.server import HomeServer @@ -191,7 +191,7 @@ FilterEvent = TypeVar("FilterEvent", EventBase, UserPresenceState, JsonDict) class FilterCollection: - def __init__(self, hs: "HomeServer", filter_json: JsonDict): + def __init__(self, hs: "HomeServer", filter_json: JsonMapping): self._filter_json = filter_json room_filter_json = self._filter_json.get("room", {}) @@ -219,7 +219,7 @@ class FilterCollection: def __repr__(self) -> str: return "<FilterCollection %s>" % (json.dumps(self._filter_json),) - def get_filter_json(self) -> JsonDict: + def get_filter_json(self) -> JsonMapping: return self._filter_json def timeline_limit(self) -> int: @@ -313,7 +313,7 @@ class FilterCollection: class Filter: - def __init__(self, hs: "HomeServer", filter_json: JsonDict): + def __init__(self, hs: "HomeServer", filter_json: JsonMapping): self._hs = hs self._store = hs.get_datastores().main self.filter_json = filter_json |