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.

streams: Improve formatting of channel archive/unarchive notifications.

whilstsomebody5c33cc9eabf9
diff --git a/zerver/actions/streams.py b/zerver/actions/streams.py
index e1360d765fd..f9a58a83af1 100644
--- a/zerver/actions/streams.py
+++ b/zerver/actions/streams.py
@@ -188,7 +188,9 @@ def do_deactivate_stream(stream: Stream, *, acting_user: UserProfile | None) ->
sender,
stream,
topic_name=str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME),
- content=_("Channel {channel_name} has been archived.").format(channel_name=stream.name),
+ content=_("Channel #**{channel_name}** has been archived.").format(
+ channel_name=stream.name
+ ),
archived_channel_notice=True,
limit_unread_user_ids=set(),
)
@@ -310,7 +312,7 @@ def do_unarchive_stream(stream: Stream, new_name: str, *, acting_user: UserProfi
sender,
stream,
str(Realm.STREAM_EVENTS_NOTIFICATION_TOPIC_NAME),
- _("Channel {channel_name} un-archived.").format(channel_name=new_name),
+ _("Channel #**{channel_name}** has been unarchived.").format(channel_name=new_name),
)
diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py
index 5960e0f8ca3..027584eeca0 100644
--- a/zerver/tests/test_subs.py
+++ b/zerver/tests/test_subs.py
@@ -2012,7 +2012,7 @@ class StreamAdminTest(ZulipTestCase):
self.assertTrue(check_subscriptions_exists(user_profile, stream))
# Assert that a notification message was sent for the archive.
message = self.get_last_message()
- expected_content = f"Channel {stream.name} has been archived."
+ expected_content = f"Channel #**{stream.name}** has been archived."
self.assertEqual(message.content, expected_content)
# Assert that the message is read.
@@ -2042,7 +2042,7 @@ class StreamAdminTest(ZulipTestCase):
self.assertTrue(check_subscriptions_exists(user_profile, stream))
# Assert that a notification message was sent for the archive.
message = self.get_last_message()
- expected_content = f"Channel {stream.name} has been archived."
+ expected_content = f"Channel #**{stream.name}** has been archived."
self.assertEqual(message.content, expected_content)
# Assert that the message is read.