diff --git a/docs/FAQ.md b/docs/FAQ.md
index 04a5d160d9..03d839a679 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -369,7 +369,7 @@ through autocomplete depend upon the context automatically.
* `P` (with stream color) if the stream is valid and private,
* `✗` if the stream is invalid.
-
+
**NOTE:** If a direct message recipient's name contains comma(s) (`,`), they
are currently treated as comma-separated recipients.
diff --git a/docs/developer-feature-tutorial.md b/docs/developer-feature-tutorial.md
index 4c840e5269..e0e41a2f9c 100644
--- a/docs/developer-feature-tutorial.md
+++ b/docs/developer-feature-tutorial.md
@@ -2,7 +2,7 @@
This tutorial shows how typing indicator was implemented in the client. The process for adding a new feature to zulip terminal varies greatly depending on the feature. This tutorial is intended to make you familiar with the general process.
-Since the typing indicator data for the other user in pm cannot be generated locally, it should be received from the client.
+Since the typing indicator data for the other user in dm cannot be generated locally, it should be received from the client.
A quick google search for `zulip typing indicator` points to https://zulip.readthedocs.io/en/latest/subsystems/typing-indicators.html. This document explains how typing indicator is implemented on the web client and is useful in understanding how typing indicator works internally.
@@ -113,9 +113,9 @@ To check for the above conditions, we create a function in `ui.py`:
```python
def handle_typing_event(self, event: Dict['str', Any]) -> None:
- # If the user is in pm narrow with the person typing
+ # If the user is in dm narrow with the person typing
if len(self.model.narrow) == 1 and\
- self.model.narrow[0][0] == 'pm_with' and\
+ self.model.narrow[0][0] == 'dm_with' and\
event['sender']['email'] in self.model.narrow[0][1].split(','):
if event['op'] == 'start':
user = self.model.user_dict[event['sender']['email']]
diff --git a/docs/getting-started-imgs/raw/send-pm-autocomplete1-raw.png b/docs/getting-started-imgs/raw/send-dm-autocomplete1-raw.png
similarity index 100%
rename from docs/getting-started-imgs/raw/send-pm-autocomplete1-raw.png
rename to docs/getting-started-imgs/raw/send-dm-autocomplete1-raw.png
diff --git a/docs/getting-started-imgs/raw/send-pm-autocomplete2-raw.png b/docs/getting-started-imgs/raw/send-dm-autocomplete2-raw.png
similarity index 100%
rename from docs/getting-started-imgs/raw/send-pm-autocomplete2-raw.png
rename to docs/getting-started-imgs/raw/send-dm-autocomplete2-raw.png
diff --git a/docs/getting-started-imgs/raw/send-pm-raw.png b/docs/getting-started-imgs/raw/send-dm-raw.png
similarity index 100%
rename from docs/getting-started-imgs/raw/send-pm-raw.png
rename to docs/getting-started-imgs/raw/send-dm-raw.png
diff --git a/docs/getting-started-imgs/send-pm-autocomplete1.png b/docs/getting-started-imgs/send-dm-autocomplete1.png
similarity index 100%
rename from docs/getting-started-imgs/send-pm-autocomplete1.png
rename to docs/getting-started-imgs/send-dm-autocomplete1.png
diff --git a/docs/getting-started-imgs/send-pm-autocomplete2.png b/docs/getting-started-imgs/send-dm-autocomplete2.png
similarity index 100%
rename from docs/getting-started-imgs/send-pm-autocomplete2.png
rename to docs/getting-started-imgs/send-dm-autocomplete2.png
diff --git a/docs/getting-started-imgs/send-pm.png b/docs/getting-started-imgs/send-dm.png
similarity index 100%
rename from docs/getting-started-imgs/send-pm.png
rename to docs/getting-started-imgs/send-dm.png
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 831290c350..337a600d8c 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -138,7 +138,7 @@ If you want to show you agree with the current message, type + to add
Let's try sending a direct message to the author of a message. Select the message you sent to the [#test here](https://chat.zulip.org/#narrow/stream/7-test-here) stream earlier and press shiftr to send a direct message to yourself. Type your message in the message editor that appears at the bottom of the middle column and then type ctrld to send. Press the shiftp hotkey as we did earlier in the tutorial to narrow to your direct messages and make sure everything worked properly.
-
+
### Send a Direct Message to Someone New
@@ -159,8 +159,8 @@ Try following the steps above to send a message to the Welcome Bot!
> It's best to use ctrlf to autocomplete the name and Zulip address of the person (or bot) you want to message; if you just type in their full name, Zulip Terminal does not know for sure who you are trying to send to - and there may be multiple people with that name!
-
-
+
+
### Create a New Topic
diff --git a/tests/config/test_keys.py b/tests/config/test_keys.py
index 752e69af29..bb38bdb623 100644
--- a/tests/config/test_keys.py
+++ b/tests/config/test_keys.py
@@ -144,7 +144,7 @@ def test_display_key_for_urwid_key(urwid_key: str, display_key: str) -> None:
COMMAND_TO_DISPLAY_KEYS = [
("NEXT_LINE", ["Down", "Ctrl n"]),
("TOGGLE_STAR_STATUS", ["Ctrl s", "*"]),
- ("ALL_PM", ["P"]),
+ ("ALL_DM", ["P"]),
]
diff --git a/tests/conftest.py b/tests/conftest.py
index ad92c4cc71..39c12a703a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -450,7 +450,7 @@ def msg_template_factory(
"""
Generate message template for all types of messages(stream/PM/group)
"""
- # TODO: Separate Message into distinct types for stream and private messages.
+ # TODO: Separate Message into distinct types for stream and direct messages.
message = Message(
id=msg_id,
sender_full_name="Foo Foo",
@@ -500,31 +500,31 @@ def extra_stream_msg_template() -> Message:
@pytest.fixture
-def pm_template() -> Message:
+def dm_template() -> Message:
recipients = display_recipient_factory([(5179, "Boo Boo"), (5140, "Foo Foo")])
return msg_template_factory(537287, "private", 1520918736, recipients=recipients)
@pytest.fixture
-def group_pm_template() -> Message:
+def group_dm_template() -> Message:
recipients = display_recipient_factory(
[(5179, "Boo Boo"), (5140, "Foo Foo"), (5180, "Bar Bar")]
)
return msg_template_factory(537288, "private", 1520918737, recipients=recipients)
-@pytest.fixture(params=["pm_template", "group_pm_template"])
-def private_message_fixture(request: Any) -> Message:
+@pytest.fixture(params=["dm_template", "group_dm_template"])
+def direct_message_fixture(request: Any) -> Message:
return request.getfixturevalue(request.param)
@pytest.fixture(
- params=["stream_msg_template", "pm_template", "group_pm_template"],
+ params=["stream_msg_template", "dm_template", "group_dm_template"],
ids=["stream_message", "pm_message", "group_pm_message"],
)
def message_fixture(request: Any) -> Message:
"""
- Acts as a parametrize fixture for stream msg, pms and group_pms.
+ Acts as a parametrize fixture for stream msg, dms and group_pms.
"""
# `request` currently does not have an exported Pytest type.
# TODO: Use the exported type when it's made available.
@@ -535,8 +535,8 @@ def message_fixture(request: Any) -> Message:
@pytest.fixture
def messages_successful_response(
stream_msg_template: Message,
- pm_template: Message,
- group_pm_template: Message,
+ dm_template: Message,
+ group_dm_template: Message,
) -> Dict[str, Any]:
"""
A successful response from a /messages API query.
@@ -546,8 +546,8 @@ def messages_successful_response(
"anchor": 10000000000000000,
"messages": [
stream_msg_template,
- pm_template,
- group_pm_template,
+ dm_template,
+ group_dm_template,
],
"result": "success",
"msg": "",
@@ -1060,7 +1060,7 @@ def initial_index() -> Index:
@pytest.fixture
def empty_index(
- stream_msg_template: Message, pm_template: Message, group_pm_template: Message
+ stream_msg_template: Message, dm_template: Message, group_dm_template: Message
) -> Index:
return deepcopy(
Index(
@@ -1068,8 +1068,8 @@ def empty_index(
all_msg_ids=set(),
starred_msg_ids=set(),
mentioned_msg_ids=set(),
- private_msg_ids=set(),
- private_msg_ids_by_user_ids=defaultdict(set, {}),
+ direct_msg_ids=set(),
+ direct_msg_ids_by_user_ids=defaultdict(set, {}),
stream_msg_ids_by_stream_id=defaultdict(set, {}),
topic_msg_ids=defaultdict(dict, {}),
edited_messages=set(),
@@ -1079,8 +1079,8 @@ def empty_index(
lambda: {},
{
stream_msg_template["id"]: stream_msg_template,
- pm_template["id"]: pm_template,
- group_pm_template["id"]: group_pm_template,
+ dm_template["id"]: dm_template,
+ group_dm_template["id"]: group_dm_template,
},
),
)
@@ -1104,7 +1104,7 @@ def index_stream(empty_index: Index) -> Index:
"""
index = empty_index
index["stream_msg_ids_by_stream_id"] = defaultdict(set, {205: {537286}})
- index["private_msg_ids"] = {537287, 537288}
+ index["direct_msg_ids"] = {537287, 537288}
return index
@@ -1140,26 +1140,26 @@ def index_multiple_topic_msg(
@pytest.fixture
def index_user(empty_index: Index) -> Index:
"""
- Expected index of initial_data when model.narrow = [['pm_with',
+ Expected index of initial_data when model.narrow = [['dm_with',
'boo@zulip.com'],
"""
user_ids = frozenset({5179, 5140})
index = empty_index
- index["private_msg_ids_by_user_ids"] = defaultdict(set, {user_ids: {537287}})
- index["private_msg_ids"] = {537287, 537288}
+ index["direct_msg_ids_by_user_ids"] = defaultdict(set, {user_ids: {537287}})
+ index["direct_msg_ids"] = {537287, 537288}
return index
@pytest.fixture
def index_user_multiple(empty_index: Index) -> Index:
"""
- Expected index of initial_data when model.narrow = [['pm_with',
+ Expected index of initial_data when model.narrow = [['dm_with',
'boo@zulip.com, bar@zulip.com'],
"""
user_ids = frozenset({5179, 5140, 5180})
index = empty_index
- index["private_msg_ids_by_user_ids"] = defaultdict(set, {user_ids: {537288}})
- index["private_msg_ids"] = {537287, 537288}
+ index["direct_msg_ids_by_user_ids"] = defaultdict(set, {user_ids: {537288}})
+ index["direct_msg_ids"] = {537287, 537288}
return index
@@ -1178,7 +1178,7 @@ def index_all_starred(empty_index: Index, request: Any) -> Index:
msgs_with_stars = request.param
index = empty_index
index["starred_msg_ids"] = msgs_with_stars
- index["private_msg_ids"] = {537287, 537288}
+ index["direct_msg_ids"] = {537287, 537288}
for msg_id, msg in index["messages"].items():
if msg_id in msgs_with_stars and "starred" not in msg["flags"]:
msg["flags"].append("starred")
@@ -1192,7 +1192,7 @@ def index_all_mentions(
mentioned_messages, wildcard_mentioned_messages = mentioned_messages_combination
index = empty_index
index["mentioned_msg_ids"] = mentioned_messages | wildcard_mentioned_messages
- index["private_msg_ids"] = {537287, 537288}
+ index["direct_msg_ids"] = {537287, 537288}
for msg_id, msg in index["messages"].items():
if msg_id in mentioned_messages and "mentioned" not in msg["flags"]:
msg["flags"].append("mentioned")
@@ -1468,7 +1468,7 @@ def classified_unread_counts() -> Dict[str, Any]:
"""
return {
"all_msg": 12,
- "all_pms": 8,
+ "all_dms": 8,
"unread_topics": {
(1000, "Some general unread topic"): 3,
(99, "Some private unread topic"): 1,
diff --git a/tests/core/test_core.py b/tests/core/test_core.py
index ff6701a41d..205be04e04 100644
--- a/tests/core/test_core.py
+++ b/tests/core/test_core.py
@@ -247,7 +247,7 @@ def test_narrow_to_user(
recipients = frozenset([controller.model.user_id, user_id])
assert controller.model.recipients == recipients
widget = controller.view.message_view.log.extend.call_args_list[0][0][0][0]
- id_list = index_user["private_msg_ids_by_user_ids"][recipients]
+ id_list = index_user["direct_msg_ids_by_user_ids"][recipients]
assert {widget.original_widget.message["id"]} == id_list
@pytest.mark.parametrize(
@@ -287,7 +287,7 @@ def test_narrow_to_all_messages(
assert msg_ids == id_list
assert final_focus_msg_id == expected_final_focus_msg_id
- def test_narrow_to_all_pm(
+ def test_narrow_to_all_dm(
self, mocker: MockerFixture, controller: Controller, index_user: Index
) -> None:
controller.model.narrow = []
@@ -296,13 +296,13 @@ def test_narrow_to_all_pm(
controller.model.user_id = 1
controller.model.user_email = "some@email"
- controller.narrow_to_all_pm() # FIXME: Add id narrowing test
+ controller.narrow_to_all_dm() # FIXME: Add id narrowing test
assert controller.model.narrow == [["is", "private"]]
controller.view.message_view.log.clear.assert_called_once_with()
widgets = controller.view.message_view.log.extend.call_args_list[0][0][0]
- id_list = index_user["private_msg_ids"]
+ id_list = index_user["direct_msg_ids"]
msg_ids = {widget.original_widget.message["id"] for widget in widgets}
assert msg_ids == id_list
@@ -514,7 +514,7 @@ def test_stream_muting_confirmation_popup(
"Default_all_msg_search",
"redo_default_search",
"search_within_stream",
- "pm_search_again",
+ "dm_search_again",
"search_within_topic_narrow",
],
)
diff --git a/tests/helper/test_helper.py b/tests/helper/test_helper.py
index 2e32e5c10f..c68f62e773 100644
--- a/tests/helper/test_helper.py
+++ b/tests/helper/test_helper.py
@@ -178,7 +178,7 @@ def test_index_starred(
model.narrow = [["is", "starred"]]
model.is_search_narrow.return_value = False
expected_index: Dict[str, Any] = dict(
- empty_index, private_msg_ids={537287, 537288}, starred_msg_ids=msgs_with_stars
+ empty_index, direct_msg_ids={537287, 537288}, starred_msg_ids=msgs_with_stars
)
for msg_id, msg in expected_index["messages"].items():
if msg_id in msgs_with_stars and "starred" not in msg["flags"]:
@@ -211,7 +211,7 @@ def test_index_mentioned_messages(
model.is_search_narrow.return_value = False
expected_index: Dict[str, Any] = dict(
empty_index,
- private_msg_ids={537287, 537288},
+ direct_msg_ids={537287, 537288},
mentioned_msg_ids=(mentioned_messages | wildcard_mentioned_messages),
)
diff --git a/tests/model/test_model.py b/tests/model/test_model.py
index 2cd811af4b..aa118a5e59 100644
--- a/tests/model/test_model.py
+++ b/tests/model/test_model.py
@@ -407,9 +407,9 @@ def test_is_search_narrow(self, model, narrow, is_search_narrow):
"bad_args",
[
dict(topic="some topic"),
- dict(stream="foo", pm_with="someone"),
- dict(topic="blah", pm_with="someone"),
- dict(pm_with="someone", topic="foo"),
+ dict(stream="foo", dm_with="someone"),
+ dict(topic="blah", dm_with="someone"),
+ dict(dm_with="someone", topic="foo"),
],
)
def test_set_narrow_bad_input(self, model, bad_args):
@@ -428,7 +428,7 @@ def test_set_narrow_bad_input(self, model, bad_args):
([["is", "starred"]], dict(starred=True)),
([["is", "mentioned"]], dict(mentioned=True)),
([["is", "private"]], dict(pms=True)),
- ([["pm-with", "FOO@zulip.com"]], dict(pm_with="FOO@zulip.com")),
+ ([["pm-with", "FOO@zulip.com"]], dict(dm_with="FOO@zulip.com")),
],
)
def test_set_narrow_already_set(self, model, narrow, good_args):
@@ -449,7 +449,7 @@ def test_set_narrow_already_set(self, model, narrow, good_args):
([], [["is", "starred"]], dict(starred=True)),
([], [["is", "mentioned"]], dict(mentioned=True)),
([], [["is", "private"]], dict(pms=True)),
- ([], [["pm-with", "FOOBOO@gmail.com"]], dict(pm_with="FOOBOO@gmail.com")),
+ ([], [["pm-with", "FOOBOO@gmail.com"]], dict(dm_with="FOOBOO@gmail.com")),
],
)
def test_set_narrow_not_already_set(
@@ -478,16 +478,16 @@ def test_set_narrow_not_already_set(
{"topic_msg_ids": {1: {"BOO": {0, 1}}}},
set(),
),
- ([["is", "private"]], {"private_msg_ids": {0, 1}}, {0, 1}),
+ ([["is", "private"]], {"direct_msg_ids": {0, 1}}, {0, 1}),
(
[["pm-with", "FOO@zulip.com"]],
- {"private_msg_ids_by_user_ids": {frozenset({1, 2}): {0, 1}}},
+ {"direct_msg_ids_by_user_ids": {frozenset({1, 2}): {0, 1}}},
{0, 1},
),
(
[["pm-with", "FOO@zulip.com"]],
{ # Covers recipient empty-set case
- "private_msg_ids_by_user_ids": {
+ "direct_msg_ids_by_user_ids": {
frozenset({1, 3}): {0, 1} # NOTE {1,3} not {1,2}
}
},
@@ -2283,12 +2283,12 @@ def test_notify_users_enabled(
[(True, "New direct message from Foo Foo"), (False, "private content here.")],
)
def test_notify_users_hides_PM_content_based_on_user_setting(
- self, mocker, model, private_message_fixture, hide_content, expected_content
+ self, mocker, model, direct_message_fixture, hide_content, expected_content
):
notify = mocker.patch(MODULE + ".notify")
model._user_settings["pm_content_in_desktop_notifications"] = not hide_content
- message = private_message_fixture
+ message = direct_message_fixture
message["user_id"] = 5179
message["flags"] = []
@@ -4521,20 +4521,20 @@ def test_next_unread_topic_from_message__empty_narrow(
assert unread_topic == next_unread_topic
- def test_get_next_unread_pm(self, model):
+ def test_get_next_unread_dm(self, model):
model.unread_counts = {"unread_pms": {1: 1, 2: 1}}
return_value = model.get_next_unread_pm()
assert return_value == 1
assert model.last_unread_pm == 1
- def test_get_next_unread_pm_again(self, model):
+ def test_get_next_unread_dm_again(self, model):
model.unread_counts = {"unread_pms": {1: 1, 2: 1}}
model.last_unread_pm = 1
return_value = model.get_next_unread_pm()
assert return_value == 2
assert model.last_unread_pm == 2
- def test_get_next_unread_pm_no_unread(self, model):
+ def test_get_next_unread_dm_no_unread(self, model):
model.unread_counts = {"unread_pms": {}}
return_value = model.get_next_unread_pm()
assert return_value is None
diff --git a/tests/ui/test_ui_tools.py b/tests/ui/test_ui_tools.py
index 0a4d9ec030..28ae866a63 100644
--- a/tests/ui/test_ui_tools.py
+++ b/tests/ui/test_ui_tools.py
@@ -942,8 +942,8 @@ def test_keypress_NEXT_UNREAD_TOPIC_no_stream(
assert mid_col_view.controller.narrow_to_topic.called is False
assert return_value == key
- @pytest.mark.parametrize("key", keys_for_command("NEXT_UNREAD_PM"))
- def test_keypress_NEXT_UNREAD_PM_stream(
+ @pytest.mark.parametrize("key", keys_for_command("NEXT_UNREAD_DM"))
+ def test_keypress_NEXT_UNREAD_DM_stream(
self, mid_col_view, mocker, key, widget_size
):
size = widget_size(mid_col_view)
@@ -959,8 +959,8 @@ def test_keypress_NEXT_UNREAD_PM_stream(
contextual_message_id=1,
)
- @pytest.mark.parametrize("key", keys_for_command("NEXT_UNREAD_PM"))
- def test_keypress_NEXT_UNREAD_PM_no_pm(
+ @pytest.mark.parametrize("key", keys_for_command("NEXT_UNREAD_DM"))
+ def test_keypress_NEXT_UNREAD_DM_no_dm(
self, mid_col_view, mocker, key, widget_size
):
size = widget_size(mid_col_view)
@@ -971,8 +971,8 @@ def test_keypress_NEXT_UNREAD_PM_no_pm(
assert return_value == key
- @pytest.mark.parametrize("key", keys_for_command("PRIVATE_MESSAGE"))
- def test_keypress_PRIVATE_MESSAGE(self, mid_col_view, mocker, key, widget_size):
+ @pytest.mark.parametrize("key", keys_for_command("DIRECT_MESSAGE"))
+ def test_keypress_DIRECT_MESSAGE(self, mid_col_view, mocker, key, widget_size):
size = widget_size(mid_col_view)
mocker.patch(MIDCOLVIEW + ".focus_position")
mid_col_view.model.get_next_unread_pm.return_value = None
@@ -1128,7 +1128,7 @@ def mock_external_classes(self, mocker):
self.view.model = mocker.Mock()
self.view.model.unread_counts = { # Minimal, though an UnreadCounts
"all_msg": 2,
- "all_pms": 0,
+ "all_dms": 0,
"streams": {
86: 1,
14: 1,
@@ -1152,7 +1152,7 @@ def mock_external_classes(self, mocker):
def test_menu_view(self, mocker):
self.streams_view = mocker.patch(VIEWS + ".LeftColumnView.streams_view")
home_button = mocker.patch(VIEWS + ".HomeButton")
- pm_button = mocker.patch(VIEWS + ".PMButton")
+ dm_button = mocker.patch(VIEWS + ".DMButton")
starred_button = mocker.patch(VIEWS + ".StarredButton")
mocker.patch(VIEWS + ".urwid.ListBox")
mocker.patch(VIEWS + ".urwid.SimpleFocusListWalker")
@@ -1161,7 +1161,7 @@ def test_menu_view(self, mocker):
home_button.assert_called_once_with(
controller=left_col_view.controller, count=2
)
- pm_button.assert_called_once_with(controller=left_col_view.controller, count=0)
+ dm_button.assert_called_once_with(controller=left_col_view.controller, count=0)
starred_button.assert_called_once_with(
controller=left_col_view.controller, count=3
)
diff --git a/tests/ui/test_utils.py b/tests/ui/test_utils.py
index 88f0e16785..b84c01c426 100644
--- a/tests/ui/test_utils.py
+++ b/tests/ui/test_utils.py
@@ -13,7 +13,7 @@
@pytest.mark.parametrize(
"msg, narrow, muted_streams, is_muted_topic_return_value, muted",
[
- ( # PM TEST
+ ( # DM TEST
{
"type": "private",
# ...
diff --git a/tests/ui_tools/test_boxes.py b/tests/ui_tools/test_boxes.py
index c4e89a2b58..91dc3c401f 100644
--- a/tests/ui_tools/test_boxes.py
+++ b/tests/ui_tools/test_boxes.py
@@ -186,7 +186,7 @@ def test_generic_autocomplete_stream_and_topic(
([1001], False, []),
([1001, 11], True, [11]),
],
- ids=["pm_only_with_oneself", "group_pm"],
+ ids=["dm_only_with_oneself", "group_dm"],
)
def test_not_calling_typing_method_to_oneself(
self,
@@ -224,7 +224,7 @@ def test_not_calling_typing_method_to_oneself(
)
@pytest.mark.parametrize("key", keys_for_command("SEND_MESSAGE"))
- def test_not_calling_send_private_message_without_recipients(
+ def test_not_calling_send_direct_message_without_recipients(
self,
key: str,
mocker: MockerFixture,
diff --git a/tests/ui_tools/test_buttons.py b/tests/ui_tools/test_buttons.py
index adc2faa127..0e78ac3cc1 100644
--- a/tests/ui_tools/test_buttons.py
+++ b/tests/ui_tools/test_buttons.py
@@ -10,10 +10,10 @@
from zulipterminal.config.symbols import CHECK_MARK, MUTE_MARKER
from zulipterminal.ui_tools.buttons import (
DecodedStream,
+ DMButton,
EmojiButton,
MessageLinkButton,
ParsedNarrowLink,
- PMButton,
StarredButton,
StreamButton,
TopButton,
@@ -179,14 +179,14 @@ def test_update_widget(
set_attr_map.assert_called_once_with({None: top_button.label_style})
-class TestPMButton:
+class TestDMButton:
def test_button_text_length(self, mocker: MockerFixture, count: int = 10) -> None:
- pm_button = PMButton(controller=mocker.Mock(), count=count)
- assert len(pm_button.label_text) == 20
+ dm_button = DMButton(controller=mocker.Mock(), count=count)
+ assert len(dm_button.label_text) == 20
def test_button_text_title(self, mocker: MockerFixture, count: int = 10) -> None:
- pm_button = PMButton(controller=mocker.Mock(), count=count)
- title_text = pm_button.label_text[:-3].strip()
+ dm_button = DMButton(controller=mocker.Mock(), count=count)
+ title_text = dm_button.label_text[:-3].strip()
assert title_text == "Direct messages"
diff --git a/tests/ui_tools/test_messages.py b/tests/ui_tools/test_messages.py
index 08ba7d0661..5b557284c6 100644
--- a/tests/ui_tools/test_messages.py
+++ b/tests/ui_tools/test_messages.py
@@ -71,7 +71,7 @@ def test_init_fails_with_bad_message_type(self):
with pytest.raises(RuntimeError):
MessageBox(message, self.model, None)
- def test_private_message_to_self(self, mocker):
+ def test_direct_message_to_self(self, mocker):
message = dict(
type="private",
display_recipient=[
@@ -85,13 +85,13 @@ def test_private_message_to_self(self, mocker):
)
self.model.user_email = "foo@zulip.com"
mocker.patch(
- MODULE + ".MessageBox._is_private_message_to_self", return_value=True
+ MODULE + ".MessageBox._is_direct_message_to_self", return_value=True
)
mocker.patch.object(MessageBox, "main_view")
msg_box = MessageBox(message, self.model, None)
assert msg_box.recipient_emails == ["foo@zulip.com"]
- msg_box._is_private_message_to_self.assert_called_once_with()
+ msg_box._is_direct_message_to_self.assert_called_once_with()
@pytest.mark.parametrize(
"content, expected_markup",
@@ -827,7 +827,7 @@ def test_main_view_renders_slash_me(self, mocker, message, content, is_me_messag
ids=[
"different_stream_before",
"different_topic_before",
- "PM_before",
+ "DM_before",
],
)
def test_main_view_generates_stream_header(
@@ -883,11 +883,11 @@ def test_main_view_generates_stream_header(
{"type": "stream"},
],
ids=[
- "larger_pm_group",
+ "larger_dm_group",
"stream_before",
],
)
- def test_main_view_generates_PM_header(
+ def test_main_view_generates_DM_header(
self, mocker, message, to_vary_in_last_message
):
last_message = dict(message, **to_vary_in_last_message)
@@ -1041,7 +1041,7 @@ def test_msg_generates_search_and_header_bar(
assert header_bar[0].text.startswith(assert_header_bar)
assert search_bar.text_to_fill == assert_search_bar
- # Assume recipient (PM/stream/topic) header is unchanged below
+ # Assume recipient (DM/stream/topic) header is unchanged below
@pytest.mark.parametrize(
"message",
[
diff --git a/tests/ui_tools/test_popups.py b/tests/ui_tools/test_popups.py
index 878be178c4..840735029c 100644
--- a/tests/ui_tools/test_popups.py
+++ b/tests/ui_tools/test_popups.py
@@ -1023,8 +1023,8 @@ def test_keypress_any_key(
],
ids=[
"stream_message_id",
- "pm_message_id",
- "group_pm_message_id",
+ "dm_message_id",
+ "group_dm_message_id",
],
)
def test_keypress_edit_history(
diff --git a/zulipterminal/config/keys.py b/zulipterminal/config/keys.py
index a86420a364..5095b6c893 100644
--- a/zulipterminal/config/keys.py
+++ b/zulipterminal/config/keys.py
@@ -137,7 +137,7 @@ class KeyBinding(TypedDict):
'help_text': 'New message to a stream',
'key_category': 'open_compose',
},
- 'PRIVATE_MESSAGE': {
+ 'DIRECT_MESSAGE': {
'keys': ['x'],
'help_text': 'New message to a person or group of people',
'key_category': 'open_compose',
@@ -214,7 +214,7 @@ class KeyBinding(TypedDict):
'help_text': 'View all messages',
'key_category': 'narrowing',
},
- 'ALL_PM': {
+ 'ALL_DM': {
'keys': ['P'],
'help_text': 'View all direct messages',
'key_category': 'narrowing',
@@ -234,7 +234,7 @@ class KeyBinding(TypedDict):
'help_text': 'Next unread topic',
'key_category': 'narrowing',
},
- 'NEXT_UNREAD_PM': {
+ 'NEXT_UNREAD_DM': {
'keys': ['p'],
'help_text': 'Next unread direct message',
'key_category': 'narrowing',
@@ -346,7 +346,7 @@ class KeyBinding(TypedDict):
'help_text': 'Show/hide user information',
'key_category': 'user_list',
},
- 'NARROW_TO_USER_PM': {
+ 'NARROW_TO_USER_DM': {
# Added to clarify functionality of button activation,
# as opposed to opening user profile or other effects.
# Implementation uses ACTIVATE_BUTTON command.
diff --git a/zulipterminal/core.py b/zulipterminal/core.py
index 61c5f79922..540144174f 100644
--- a/zulipterminal/core.py
+++ b/zulipterminal/core.py
@@ -222,7 +222,7 @@ def clamp(n: int, minn: int, maxn: int) -> int:
width = clamp(max_cols, min_width, max_width)
scaling = 1 - ((width - min_width) / (4 * (max_width - min_width)))
max_popup_cols = int(scaling * max_cols)
- # Scale Height
+ # Scale Height.
max_popup_rows = 3 * max_rows // 4
return max_popup_cols, max_popup_rows
@@ -645,7 +645,7 @@ def narrow_to_user(
) -> None:
self._narrow_to(
anchor=contextual_message_id,
- pm_with=", ".join(recipient_emails),
+ dm_with=", ".join(recipient_emails),
)
def narrow_to_all_messages(
@@ -653,7 +653,7 @@ def narrow_to_all_messages(
) -> None:
self._narrow_to(anchor=contextual_message_id)
- def narrow_to_all_pm(self, *, contextual_message_id: Optional[int] = None) -> None:
+ def narrow_to_all_dm(self, *, contextual_message_id: Optional[int] = None) -> None:
self._narrow_to(anchor=contextual_message_id, pms=True)
def narrow_to_all_starred(self) -> None:
diff --git a/zulipterminal/helper.py b/zulipterminal/helper.py
index a71d055b74..329df8b83f 100644
--- a/zulipterminal/helper.py
+++ b/zulipterminal/helper.py
@@ -104,8 +104,8 @@ class Index(TypedDict):
all_msg_ids: Set[int]
starred_msg_ids: Set[int]
mentioned_msg_ids: Set[int]
- private_msg_ids: Set[int]
- private_msg_ids_by_user_ids: Dict[FrozenSet[int], Set[int]]
+ direct_msg_ids: Set[int]
+ direct_msg_ids_by_user_ids: Dict[FrozenSet[int], Set[int]]
stream_msg_ids_by_stream_id: Dict[int, Set[int]]
topic_msg_ids: Dict[int, Dict[str, Set[int]]]
# Extra cached information
@@ -121,8 +121,8 @@ class Index(TypedDict):
all_msg_ids=set(),
starred_msg_ids=set(),
mentioned_msg_ids=set(),
- private_msg_ids=set(),
- private_msg_ids_by_user_ids=defaultdict(set),
+ direct_msg_ids=set(),
+ direct_msg_ids_by_user_ids=defaultdict(set),
stream_msg_ids_by_stream_id=defaultdict(set),
topic_msg_ids=defaultdict(dict),
edited_messages=set(),
@@ -135,11 +135,11 @@ class Index(TypedDict):
class UnreadCounts(TypedDict):
all_msg: int
- all_pms: int
+ all_dms: int
all_mentions: int
unread_topics: Dict[Tuple[int, str], int] # stream_id, topic
unread_pms: Dict[int, int] # sender_id
- unread_huddles: Dict[FrozenSet[int], int] # Group pms
+ unread_huddles: Dict[FrozenSet[int], int] # Group dms
streams: Dict[int, int] # stream_id
@@ -206,11 +206,11 @@ def update_unreads(unreads: Dict[KeyT, int], key: KeyT) -> None:
unread_counts["unread_topics"], (stream_id, message["subject"])
)
update_unreads(unread_counts["streams"], stream_id)
- # self-pm has only one display_recipient
- # 1-1 pms have 2 display_recipient
+ # self-dm has only one display_recipient
+ # 1-1 dms have 2 display_recipient
elif len(message["display_recipient"]) <= 2:
update_unreads(unread_counts["unread_pms"], message["sender_id"])
- else: # If it's a group pm
+ else: # If it's a group dm
update_unreads(
unread_counts["unread_huddles"],
frozenset(
@@ -227,7 +227,7 @@ def _set_count_in_view(
) -> None:
"""
This function for the most part contains the logic for setting the
- count in the UI buttons. The later buttons (all_msg, all_pms)
+ count in the UI buttons. The later buttons (all_msg, all_dms)
additionally set the current count in the model and make use of the
same in the UI.
"""
@@ -238,7 +238,7 @@ def _set_count_in_view(
toggled_stream_id = controller.view.topic_w.stream_button.stream_id
user_buttons_list = controller.view.user_w.users_btn_list
all_msg = controller.view.home_button
- all_pm = controller.view.pm_button
+ all_dm = controller.view.dm_button
all_mentioned = controller.view.mentioned_button
for message in changed_messages:
user_id = message["sender_id"]
@@ -277,8 +277,8 @@ def _set_count_in_view(
if user_button.user_id == user_id:
user_button.update_count(user_button.count + new_count)
break
- unread_counts["all_pms"] += new_count
- all_pm.update_count(unread_counts["all_pms"])
+ unread_counts["all_dms"] += new_count
+ all_dm.update_count(unread_counts["all_dms"])
if add_to_counts:
unread_counts["all_msg"] += new_count
@@ -322,7 +322,7 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
...
}
},
- 'private_msg_ids_by_user_ids': {
+ 'direct_msg_ids_by_user_ids': {
(3, 7): { # user_ids frozenset
51234,
56454,
@@ -345,7 +345,7 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
23423,
...
},
- 'private_msg_ids': {
+ 'direct_msg_ids': {
22334,
23423,
...
@@ -381,7 +381,7 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
'messages': {
# all the messages mapped to their id
# for easy retrieval of message from id
- 45645: { # PRIVATE
+ 45645: { # DIRECT
'id': 4290,
'timestamp': 1521817473,
'content': 'Hi @**Cordelia Lear**',
@@ -452,7 +452,7 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
index["mentioned_msg_ids"].add(msg["id"])
if msg["type"] == "private":
- index["private_msg_ids"].add(msg["id"])
+ index["direct_msg_ids"].add(msg["id"])
recipients = frozenset(
{recipient["id"] for recipient in msg["display_recipient"]}
)
@@ -463,7 +463,7 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
for email in narrow[0][1].split(", ")
] + [model.user_id]
if recipients == frozenset(narrow_emails):
- index["private_msg_ids_by_user_ids"][recipients].add(msg["id"])
+ index["direct_msg_ids_by_user_ids"][recipients].add(msg["id"])
if msg["type"] == "stream" and msg["stream_id"] == model.stream_id:
index["stream_msg_ids_by_stream_id"][msg["stream_id"]].add(msg["id"])
@@ -482,12 +482,12 @@ def index_messages(messages: List[Message], model: Any, index: Index) -> Index:
def classify_unread_counts(model: Any) -> UnreadCounts:
- # TODO: support group pms
+ # TODO: support group dms
unread_msg_counts = model.initial_data["unread_msgs"]
unread_counts = UnreadCounts(
all_msg=0,
- all_pms=0,
+ all_dms=0,
all_mentions=0,
unread_topics=dict(),
unread_pms=dict(),
@@ -498,11 +498,11 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
mentions_count = len(unread_msg_counts["mentions"])
unread_counts["all_mentions"] += mentions_count
- for pm in unread_msg_counts["pms"]:
- count = len(pm["unread_message_ids"])
- unread_counts["unread_pms"][pm["sender_id"]] = count
+ for dm in unread_msg_counts["pms"]:
+ count = len(dm["unread_message_ids"])
+ unread_counts["unread_pms"][dm["sender_id"]] = count
unread_counts["all_msg"] += count
- unread_counts["all_pms"] += count
+ unread_counts["all_dms"] += count
for stream in unread_msg_counts["streams"]:
count = len(stream["unread_message_ids"])
@@ -521,14 +521,14 @@ def classify_unread_counts(model: Any) -> UnreadCounts:
if stream_id not in model.muted_streams:
unread_counts["all_msg"] += count
- # store unread count of group pms in `unread_huddles`
- for group_pm in unread_msg_counts["huddles"]:
- count = len(group_pm["unread_message_ids"])
- user_ids = group_pm["user_ids_string"].split(",")
+ # store unread count of group dms in `unread_huddles`
+ for group in unread_msg_counts["huddles"]:
+ count = len(group["unread_message_ids"])
+ user_ids = group["user_ids_string"].split(",")
user_ids = frozenset(map(int, user_ids))
unread_counts["unread_huddles"][user_ids] = count
unread_counts["all_msg"] += count
- unread_counts["all_pms"] += count
+ unread_counts["all_dms"] += count
return unread_counts
@@ -719,12 +719,12 @@ def notify_if_message_sent_outside_narrow(
topic_narrow = stream_narrow + [["topic", message["subject"]]]
check_narrow_and_notify(stream_narrow, topic_narrow, controller)
elif message["type"] == "private":
- pm_narrow = [["is", "private"]]
+ dm_narrow = [["is", "private"]]
recipient_emails = [
controller.model.user_id_email_dict[user_id] for user_id in message["to"]
]
- pm_with_narrow = [["pm-with", ", ".join(recipient_emails)]]
- check_narrow_and_notify(pm_narrow, pm_with_narrow, controller)
+ dm_with_narrow = [["pm-with", ", ".join(recipient_emails)]]
+ check_narrow_and_notify(dm_narrow, dm_with_narrow, controller)
def hash_util_decode(string: str) -> str:
diff --git a/zulipterminal/model.py b/zulipterminal/model.py
index b3840a5060..87ec5f913c 100644
--- a/zulipterminal/model.py
+++ b/zulipterminal/model.py
@@ -301,7 +301,7 @@ def set_narrow(
stream: Optional[str] = None,
topic: Optional[str] = None,
pms: bool = False,
- pm_with: Optional[str] = None,
+ dm_with: Optional[str] = None,
starred: bool = False,
mentioned: bool = False,
) -> bool:
@@ -311,7 +311,7 @@ def set_narrow(
frozenset(["stream"]): [["stream", stream]],
frozenset(["stream", "topic"]): [["stream", stream], ["topic", topic]],
frozenset(["pms"]): [["is", "private"]],
- frozenset(["pm_with"]): [["pm-with", pm_with]],
+ frozenset(["dm_with"]): [["pm-with", dm_with]],
frozenset(["starred"]): [["is", "starred"]],
frozenset(["mentioned"]): [["is", "mentioned"]],
}
@@ -325,8 +325,8 @@ def set_narrow(
if new_narrow != self.narrow:
self.narrow = new_narrow
- if pm_with is not None and new_narrow[0][0] == "pm-with":
- users = pm_with.split(", ")
+ if dm_with is not None and new_narrow[0][0] == "pm-with":
+ users = dm_with.split(", ")
self.recipients = frozenset(
[self.user_dict[user]["user_id"] for user in users] + [self.user_id]
)
@@ -370,10 +370,10 @@ def get_message_ids_in_current_narrow(self) -> Set[int]:
topic = narrow[1][1]
ids = index["topic_msg_ids"][stream_id].get(topic, set())
elif narrow[0][1] == "private":
- ids = index["private_msg_ids"]
+ ids = index["direct_msg_ids"]
elif narrow[0][0] == "pm-with":
recipients = self.recipients
- ids = index["private_msg_ids_by_user_ids"].get(recipients, set())
+ ids = index["direct_msg_ids_by_user_ids"].get(recipients, set())
elif narrow[0][1] == "starred":
ids = index["starred_msg_ids"]
elif narrow[0][1] == "mentioned":
@@ -1556,7 +1556,7 @@ def get_stream_by_id(streams: List[StreamData], stream_id: int) -> StreamData:
def _handle_typing_event(self, event: Event) -> None:
"""
- Handle typing notifications (in private messages)
+ Handle typing notifications (in direct messages)
"""
assert event["type"] == "typing"
@@ -1569,7 +1569,7 @@ def _handle_typing_event(self, event: Event) -> None:
sender_email = event["sender"]["email"]
sender_id = event["sender"]["user_id"]
- # If the user is in pm narrow with the person typing
+ # If the user is in dm narrow with the person typing
# and the person typing isn't the user themselves
if (
len(narrow) == 1
diff --git a/zulipterminal/server_url.py b/zulipterminal/server_url.py
index 9d3dce7561..4c1f0fccef 100644
--- a/zulipterminal/server_url.py
+++ b/zulipterminal/server_url.py
@@ -53,7 +53,7 @@ def near_stream_message_url(server_url: str, message: Message) -> str:
return full_url
-def near_pm_message_url(server_url: str, message: Message) -> str:
+def near_dm_message_url(server_url: str, message: Message) -> str:
"""
Returns the complete encoded URL of a message from #narrow/pm-with.
Referred from zerver/lib/url_encoding.py.
@@ -61,12 +61,12 @@ def near_pm_message_url(server_url: str, message: Message) -> str:
message_id = str(message["id"])
str_user_ids = [str(recipient["id"]) for recipient in message["display_recipient"]]
- pm_str = ",".join(str_user_ids) + "-pm"
+ dm_str = ",".join(str_user_ids) + "-pm"
parts = [
server_url,
"#narrow",
"pm-with",
- pm_str,
+ dm_str,
"near",
message_id,
]
@@ -83,5 +83,5 @@ def near_message_url(server_url: str, message: Message) -> str:
if message["type"] == "stream":
url = near_stream_message_url(server_url, message)
else:
- url = near_pm_message_url(server_url, message)
+ url = near_dm_message_url(server_url, message)
return url
diff --git a/zulipterminal/ui.py b/zulipterminal/ui.py
index d0785bd928..a0fa510507 100644
--- a/zulipterminal/ui.py
+++ b/zulipterminal/ui.py
@@ -260,17 +260,17 @@ def keypress(self, size: urwid_Box, key: str) -> Optional[str]:
elif (
is_command_key("SEARCH_MESSAGES", key)
or is_command_key("NEXT_UNREAD_TOPIC", key)
- or is_command_key("NEXT_UNREAD_PM", key)
+ or is_command_key("NEXT_UNREAD_DM", key)
or is_command_key("STREAM_MESSAGE", key)
- or is_command_key("PRIVATE_MESSAGE", key)
+ or is_command_key("DIRECT_MESSAGE", key)
):
self.show_left_panel(visible=False)
self.show_right_panel(visible=False)
self.body.focus_col = 1
self.middle_column.keypress(size, key)
return key
- elif is_command_key("ALL_PM", key):
- self.pm_button.activate(key)
+ elif is_command_key("ALL_DM", key):
+ self.dm_button.activate(key)
elif is_command_key("ALL_STARRED", key):
self.starred_button.activate(key)
elif is_command_key("ALL_MENTIONS", key):
diff --git a/zulipterminal/ui_tools/boxes.py b/zulipterminal/ui_tools/boxes.py
index 1a479cadad..8552a7cf58 100644
--- a/zulipterminal/ui_tools/boxes.py
+++ b/zulipterminal/ui_tools/boxes.py
@@ -87,17 +87,17 @@ def __init__(self, view: Any) -> None:
# Set to int for stream box only
self.stream_id: Optional[int]
- # Used in PM and stream boxes
- # (empty list implies PM box empty, or not initialized)
+ # Used in DM and stream boxes
+ # (empty list implies DM box empty, or not initialized)
# Prioritizes autocomplete in message body
self.recipient_user_ids: List[int]
- # Updates server on PM typing events
+ # Updates server on DM typing events
# Is separate from recipient_user_ids because we
# don't include the user's own id in this list
self.typing_recipient_user_ids: List[int]
- # Private message recipient text entry, None if stream-box
+ # Direct message recipient text entry, None if stream-box
# or not initialized
self.to_write_box: Optional[ReadlineEdit]
@@ -168,7 +168,7 @@ def _set_regular_and_typing_recipient_user_ids(
self.typing_recipient_user_ids = list()
def send_stop_typing_status(self) -> None:
- # Send 'stop' updates only for PM narrows, when there are recipients
+ # Send 'stop' updates only for DM narrows, when there are recipients
# to send to and a prior 'start' status has already been sent.
if (
self.compose_box_status == "open_with_private"
diff --git a/zulipterminal/ui_tools/buttons.py b/zulipterminal/ui_tools/buttons.py
index 8e67d79adf..2a0e4c86db 100644
--- a/zulipterminal/ui_tools/buttons.py
+++ b/zulipterminal/ui_tools/buttons.py
@@ -143,16 +143,16 @@ def __init__(self, *, controller: Any, count: int) -> None:
)
-class PMButton(TopButton):
+class DMButton(TopButton):
def __init__(self, *, controller: Any, count: int) -> None:
- button_text = f"Direct messages [{primary_display_key_for_command('ALL_PM')}]"
+ button_text = f"Direct messages [{primary_display_key_for_command('ALL_DM')}]"
super().__init__(
controller=controller,
label_markup=(None, button_text),
prefix_markup=("title", DIRECT_MESSAGE_MARKER),
suffix_markup=("unread_count", ""),
- show_function=controller.narrow_to_all_pm,
+ show_function=controller.narrow_to_all_dm,
count=count,
)
diff --git a/zulipterminal/ui_tools/messages.py b/zulipterminal/ui_tools/messages.py
index 2b67ae6e71..e091e0e091 100644
--- a/zulipterminal/ui_tools/messages.py
+++ b/zulipterminal/ui_tools/messages.py
@@ -89,7 +89,7 @@ def __init__(self, message: Message, model: "Model", last_message: Any) -> None:
raise RuntimeError("Invalid message type")
if self.message["type"] == "private":
- if self._is_private_message_to_self():
+ if self._is_direct_message_to_self():
recipient = self.message["display_recipient"][0]
self.recipients_names = recipient["full_name"]
self.recipient_emails = [self.model.user_email]
@@ -147,7 +147,7 @@ def need_recipient_header(self) -> bool:
else:
raise RuntimeError("Invalid message type")
- def _is_private_message_to_self(self) -> bool:
+ def _is_direct_message_to_self(self) -> bool:
recipient_list = self.message["display_recipient"]
return (
len(recipient_list) == 1
@@ -964,7 +964,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
self.model.unset_search_narrow()
if self.message["type"] == "private":
if len(self.model.narrow) == 1 and self.model.narrow[0][0] == "pm-with":
- self.model.controller.narrow_to_all_pm(
+ self.model.controller.narrow_to_all_dm(
contextual_message_id=self.message["id"],
)
else:
@@ -1043,7 +1043,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
self.model.controller.view.middle_column.set_focus("footer")
elif is_command_key("EDIT_MESSAGE", key):
# User can't edit messages of others that already have a subject
- # For private messages, subject = "" (empty string)
+ # For direct messages, subject = "" (empty string)
# This also handles the realm_message_content_edit_limit_seconds == 0 case
if (
self.message["sender_id"] != self.model.user_id
@@ -1115,7 +1115,7 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
)
return key
else:
- # The remaining case is of a private message not belonging to user.
+ # The remaining case is of a direct message not belonging to user.
# Which should be already handled by the topmost if block
raise RuntimeError(
"Reached unexpected block. This should be handled at the top."
diff --git a/zulipterminal/ui_tools/utils.py b/zulipterminal/ui_tools/utils.py
index d055af44b7..5a3878d8d0 100644
--- a/zulipterminal/ui_tools/utils.py
+++ b/zulipterminal/ui_tools/utils.py
@@ -58,7 +58,7 @@ def create_msg_box_list(
# The SIM114 warnings are ignored here since combining the branches would be less clear
def is_muted(msg: Message, model: Any) -> bool:
- # PMs cannot be muted
+ # DMs cannot be muted
if msg["type"] == "private": # noqa: SIM114
return False
# In a topic narrow
diff --git a/zulipterminal/ui_tools/views.py b/zulipterminal/ui_tools/views.py
index 00158f88e2..bf681ee924 100644
--- a/zulipterminal/ui_tools/views.py
+++ b/zulipterminal/ui_tools/views.py
@@ -46,11 +46,11 @@
from zulipterminal.server_url import near_message_url
from zulipterminal.ui_tools.boxes import PanelSearchBox
from zulipterminal.ui_tools.buttons import (
+ DMButton,
EmojiButton,
HomeButton,
MentionedButton,
MessageLinkButton,
- PMButton,
StarredButton,
StreamButton,
TopicButton,
@@ -629,18 +629,18 @@ def keypress(self, size: urwid_Size, key: str) -> Optional[str]:
topic_name=topic,
)
return key
- elif is_command_key("NEXT_UNREAD_PM", key):
- # narrow to next unread pm
- pm = self.model.get_next_unread_pm()
- if pm is None:
+ elif is_command_key("NEXT_UNREAD_DM", key):
+ # narrow to next unread dm
+ dm = self.model.get_next_unread_pm()
+ if dm is None:
return key
- email = self.model.user_id_email_dict[pm]
+ email = self.model.user_id_email_dict[dm]
self.controller.narrow_to_user(
recipient_emails=[email],
- contextual_message_id=pm,
+ contextual_message_id=dm,
)
- elif is_command_key("PRIVATE_MESSAGE", key):
- # Create new PM message
+ elif is_command_key("DIRECT_MESSAGE", key):
+ # Create new DM message
self.footer.private_box_view()
self.set_focus("footer")
self.footer.focus_position = 0
@@ -792,8 +792,8 @@ def menu_view(self) -> Any:
count = self.model.unread_counts.get("all_msg", 0)
self.view.home_button = HomeButton(controller=self.controller, count=count)
- count = self.model.unread_counts.get("all_pms", 0)
- self.view.pm_button = PMButton(controller=self.controller, count=count)
+ count = self.model.unread_counts.get("all_dms", 0)
+ self.view.dm_button = DMButton(controller=self.controller, count=count)
self.view.mentioned_button = MentionedButton(
controller=self.controller,
@@ -807,7 +807,7 @@ def menu_view(self) -> Any:
)
menu_btn_list = [
self.view.home_button,
- self.view.pm_button,
+ self.view.dm_button,
self.view.mentioned_button,
self.view.starred_button,
]