mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-23 06:51:28 -04:00
Use StrCollection in place of Collection[str] in (most) handlers code. (#14922)
Due to the increased safety of StrCollection over Collection[str] and Sequence[str].
This commit is contained in:
parent
dc901a885f
commit
ba79fb4a61
13 changed files with 43 additions and 58 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
import itertools
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Collection, Dict, Iterable, List, Optional, Set, Tuple
|
||||
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Set, Tuple
|
||||
|
||||
import attr
|
||||
from unpaddedbase64 import decode_base64, encode_base64
|
||||
|
@ -23,7 +23,7 @@ from synapse.api.constants import EventTypes, Membership
|
|||
from synapse.api.errors import NotFoundError, SynapseError
|
||||
from synapse.api.filtering import Filter
|
||||
from synapse.events import EventBase
|
||||
from synapse.types import JsonDict, StreamKeyType, UserID
|
||||
from synapse.types import JsonDict, StrCollection, StreamKeyType, UserID
|
||||
from synapse.types.state import StateFilter
|
||||
from synapse.visibility import filter_events_for_client
|
||||
|
||||
|
@ -418,7 +418,7 @@ class SearchHandler:
|
|||
async def _search_by_rank(
|
||||
self,
|
||||
user: UserID,
|
||||
room_ids: Collection[str],
|
||||
room_ids: StrCollection,
|
||||
search_term: str,
|
||||
keys: Iterable[str],
|
||||
search_filter: Filter,
|
||||
|
@ -491,7 +491,7 @@ class SearchHandler:
|
|||
async def _search_by_recent(
|
||||
self,
|
||||
user: UserID,
|
||||
room_ids: Collection[str],
|
||||
room_ids: StrCollection,
|
||||
search_term: str,
|
||||
keys: Iterable[str],
|
||||
search_filter: Filter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue