diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 7a30fe3a15..254de4d5db 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1962,7 +1962,7 @@ def extract_emails(emails: Iterable[str]) -> List[str]: def check_send_stream_message(sender: UserProfile, client: Client, stream_name: str, topic: str, body: str) -> int: - addressee = Addressee.for_stream(stream_name, topic) + addressee = Addressee.for_stream_name(stream_name, topic) message = check_message(sender, client, addressee, body) return do_send_messages([message])[0] @@ -2326,7 +2326,7 @@ def internal_prep_stream_message(realm: Realm, sender: UserProfile, """ See _internal_prep_message for details of how this works. """ - addressee = Addressee.for_stream(stream_name, topic) + addressee = Addressee.for_stream_name(stream_name, topic) return _internal_prep_message( realm=realm, diff --git a/zerver/lib/addressee.py b/zerver/lib/addressee.py index 131c61cebb..f85801785d 100644 --- a/zerver/lib/addressee.py +++ b/zerver/lib/addressee.py @@ -130,7 +130,7 @@ class Addressee: return Addressee.for_stream_id(stream_id, topic_name) stream_name = cast(str, stream_name_or_id) - return Addressee.for_stream(stream_name, topic_name) + return Addressee.for_stream_name(stream_name, topic_name) elif message_type_name == 'private': if not message_to: raise JsonableError(_("Message must have recipients")) @@ -145,7 +145,7 @@ class Addressee: raise JsonableError(_("Invalid message type")) @staticmethod - def for_stream(stream_name: str, topic: str) -> 'Addressee': + def for_stream_name(stream_name: str, topic: str) -> 'Addressee': topic = validate_topic(topic) return Addressee( msg_type='stream', diff --git a/zerver/tests/test_messages.py b/zerver/tests/test_messages.py index 2ed1d34e9d..30136406aa 100644 --- a/zerver/tests/test_messages.py +++ b/zerver/tests/test_messages.py @@ -3448,7 +3448,7 @@ class CheckMessageTest(ZulipTestCase): self.make_stream(stream_name) topic_name = 'issue' message_content = 'whatever' - addressee = Addressee.for_stream(stream_name, topic_name) + addressee = Addressee.for_stream_name(stream_name, topic_name) ret = check_message(sender, client, addressee, message_content) self.assertEqual(ret['message'].sender.email, self.example_email("othello")) @@ -3471,7 +3471,7 @@ class CheckMessageTest(ZulipTestCase): client = make_client(name="test suite") stream_name = u'Россия' topic_name = 'issue' - addressee = Addressee.for_stream(stream_name, topic_name) + addressee = Addressee.for_stream_name(stream_name, topic_name) message_content = 'whatever' old_count = message_stream_count(parent)