Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

mattermost: Update references to "private message" and "PM".

Lauryn Menard2eeeda769441
diff --git a/zerver/data_import/mattermost.py b/zerver/data_import/mattermost.py
index f273823eea2..6eb16e4b99a 100644
--- a/zerver/data_import/mattermost.py
+++ b/zerver/data_import/mattermost.py
@@ -546,7 +546,7 @@ def process_posts(
post_data_list = []
for post in post_data:
if "team" not in post:
- # Mattermost doesn't specify a team for private messages
+ # Mattermost doesn't specify a team for direct messages
# in its export format. This line of code requires that
# we only be importing data from a single team (checked
# elsewhere) -- we just assume it's the target team.
@@ -579,9 +579,9 @@ def process_posts(
if "channel" in post_dict:
message_dict["channel_name"] = post_dict["channel"]
elif "channel_members" in post_dict:
- # This case is for handling posts from PMs and huddles, not channels.
- # PMs and huddles are known as direct_channels in Slack and hence
- # the name channel_members.
+ # This case is for handling posts from direct messages and huddles,
+ # not channels. Direct messages and huddles are known as direct_channels
+ # in Slack and hence the name channel_members.
channel_members = post_dict["channel_members"]
if len(channel_members) > 2:
message_dict["huddle_name"] = generate_huddle_name(channel_members)
@@ -685,7 +685,7 @@ def write_message_data(
else:
post_types = ["channel_post"]
logging.warning(
- "Skipping importing huddles and PMs since there are multiple teams in the export"
+ "Skipping importing huddles and DMs since there are multiple teams in the export"
)
for post_type in post_types:
diff --git a/zerver/tests/test_mattermost_importer.py b/zerver/tests/test_mattermost_importer.py
index cc1101dd383..84b9338d536 100644
--- a/zerver/tests/test_mattermost_importer.py
+++ b/zerver/tests/test_mattermost_importer.py
@@ -427,7 +427,7 @@ class MatterMostImporter(ZulipTestCase):
self.assertEqual(
user_handler.get_user(zerver_attachments[0]["owner"])["email"], "[email protected]"
)
- # TODO: Assert this for False after fixing the file permissions in PMs
+ # TODO: Assert this for False after fixing the file permissions in direct messages
self.assertTrue(zerver_attachments[0]["is_realm_public"])
self.assert_length(uploads_list, 1)
@@ -635,8 +635,8 @@ class MatterMostImporter(ZulipTestCase):
self.assertEqual(
warn_log.output,
[
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
],
)
@@ -870,8 +870,8 @@ class MatterMostImporter(ZulipTestCase):
self.assertEqual(
warn_log.output,
[
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
],
)
@@ -897,8 +897,8 @@ class MatterMostImporter(ZulipTestCase):
self.assertEqual(
warn_log.output,
[
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
- "WARNING:root:Skipping importing huddles and PMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
+ "WARNING:root:Skipping importing huddles and DMs since there are multiple teams in the export",
],
)