diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 99549953a4..d6c67ec716 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1842,7 +1842,7 @@ def get_recipient_from_user_ids(recipient_profile_ids: Set[int], else: return get_personal_recipient(list(recipient_profile_ids)[0]) -def validate_recipient_user_profiles(user_profiles: List[UserProfile], +def validate_recipient_user_profiles(user_profiles: Sequence[UserProfile], sender: UserProfile, allow_deactivated: bool=False) -> Set[int]: recipient_profile_ids = set() @@ -1904,7 +1904,7 @@ def recipient_for_user_ids(user_ids: Iterable[int], sender: UserProfile) -> Reci sender=sender ) -def recipient_for_user_profiles(user_profiles: List[UserProfile], forwarded_mirror_message: bool, +def recipient_for_user_profiles(user_profiles: Sequence[UserProfile], forwarded_mirror_message: bool, forwarder_user_profile: Optional[UserProfile], sender: UserProfile, allow_deactivated: bool=False) -> Recipient: diff --git a/zerver/lib/addressee.py b/zerver/lib/addressee.py index 903aa63d30..d969311e7b 100644 --- a/zerver/lib/addressee.py +++ b/zerver/lib/addressee.py @@ -91,9 +91,10 @@ class Addressee: def is_private(self) -> bool: return self._msg_type == 'private' - def user_profiles(self) -> List[UserProfile]: + def user_profiles(self) -> Sequence[UserProfile]: assert(self.is_private()) - return self._user_profiles # type: ignore # assertion protects us + assert self._user_profiles is not None + return self._user_profiles def stream(self) -> Optional[Stream]: assert(self.is_stream())