Skip to content

Commit

Permalink
refactor: Change name of update_recipients function.
Browse files Browse the repository at this point in the history
Change the name of update_recipients to
update_recipients_from_emails_in_widget.
  • Loading branch information
Subhasish-Behera committed Sep 11, 2023
1 parent aa48f18 commit bf7f923
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/ui_tools/test_boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions zulipterminal/ui_tools/boxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf7f923

Please sign in to comment.