Skip to content

Commit

Permalink
bugfix: helper: Avoid always notifying as outside narrow for group PMs.
Browse files Browse the repository at this point in the history
This commit fixes a bug that previously caused a "Message sent outside
current narrow." message in the footer in group pms (huddles) even when
on the right narrow. This happened because of the wrong separator being
used, ','. This has been changed to the relevant separator - ', '.

Test added.
  • Loading branch information
prah23 authored and neiljp committed Jun 18, 2021
1 parent 45a856c commit 96743e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/helper/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@ def test_display_error_if_present(mocker, response, footer_updated):
False,
id="all_private__pm__not_notified",
),
case(
{
"type": "private",
"to": ["foo@zulip.com", "bar@zulip.com"],
"content": "Hi",
},
[["pm_with", "foo@zulip.com, bar@zulip.com"]],
False,
id="group_private_conv__same_group_pm__not_notified",
),
case(
{
"type": "private",
Expand Down
2 changes: 1 addition & 1 deletion zulipterminal/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def notify_if_message_sent_outside_narrow(
check_narrow_and_notify(stream_narrow, topic_narrow, controller)
elif message["type"] == "private":
pm_narrow = [["is", "private"]]
pm_with_narrow = [["pm_with", ",".join(message["to"])]]
pm_with_narrow = [["pm_with", ", ".join(message["to"])]]
check_narrow_and_notify(pm_narrow, pm_with_narrow, controller)


Expand Down

0 comments on commit 96743e1

Please sign in to comment.