diff --git a/tests/ui_tools/test_boxes.py b/tests/ui_tools/test_boxes.py index 0b0367803d..28dbe3055e 100644 --- a/tests/ui_tools/test_boxes.py +++ b/tests/ui_tools/test_boxes.py @@ -408,7 +408,7 @@ def test_footer_notification_on_invalid_recipients( ), ], ) - def test_update_recipients( + def test_update_recipients_from_emails_in_widget( self, write_box: WriteBox, header: str, @@ -419,7 +419,7 @@ def test_update_recipients( assert write_box.to_write_box is not None write_box.to_write_box.edit_text = header - write_box.update_recipients(write_box.to_write_box) + write_box.update_recipients_from_emails_in_widget(write_box.to_write_box) assert write_box.recipient_emails == expected_recipient_emails assert write_box.recipient_user_ids == expected_recipient_user_ids diff --git a/zulipterminal/ui_tools/boxes.py b/zulipterminal/ui_tools/boxes.py index 5a60c42bb4..fa00e8c223 100644 --- a/zulipterminal/ui_tools/boxes.py +++ b/zulipterminal/ui_tools/boxes.py @@ -280,7 +280,7 @@ def track_idleness_and_update_status() -> None: urwid.connect_signal(self.msg_write_box, "change", on_type_send_status) - def update_recipients(self, write_box: ReadlineEdit) -> None: + def update_recipients_from_emails_in_widget(self, write_box: ReadlineEdit) -> None: self.recipient_emails = re.findall(REGEX_RECIPIENT_EMAIL, write_box.edit_text) self._set_regular_and_typing_recipient_user_ids( [self.model.user_dict[email]["user_id"] for email in self.recipient_emails] @@ -776,7 +776,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]: ) if not all_valid: return key - self.update_recipients(self.to_write_box) + self.update_recipients_from_emails_in_widget(self.to_write_box) if self.recipient_user_ids: success = self.model.send_private_message( recipients=self.recipient_user_ids, @@ -830,7 +830,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]: ) if not all_valid: return key - self.update_recipients(self.to_write_box) + self.update_recipients_from_emails_in_widget(self.to_write_box) this_draft: Composition = PrivateComposition( type="private", to=self.recipient_user_ids, @@ -905,7 +905,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]: # We extract recipients' user_ids and emails only once we know # that all the recipients are valid, to avoid including any # invalid ones. - self.update_recipients(self.to_write_box) + self.update_recipients_from_emails_in_widget(self.to_write_box) if not self.msg_body_edit_enabled: return key