streams: Change text in notification bot DM.

This commit addresses the second bullet in
zulip#31206 (comment).
This commit is contained in:
Kislay Verma
2025-04-15 20:56:59 +05:30
committed by Tim Abbott
parent c0a9ca8e9a
commit 54be18d430
2 changed files with 5 additions and 5 deletions

View File

@@ -7873,7 +7873,7 @@ class GetSubscribersTest(ZulipTestCase):
+ f"""<li><a class="stream" data-stream-id="{stream.id}" href="/#narrow/channel/{stream.id}-{stream.name}">#{stream.name}</a></li>\n"""
)
msg = f"""
<p><span class="user-mention" data-user-id="{hamlet.id}">@King Hamlet</span> subscribed you to the following channels:</p>
<p><span class="user-mention silent" data-user-id="{hamlet.id}">King Hamlet</span> subscribed you to the following channels:</p>
<ul>
{rendered_stream_list}
</ul>
@@ -7901,7 +7901,7 @@ class GetSubscribersTest(ZulipTestCase):
stream_invite_only_1 = get_stream("stream_invite_only_1", realm)
msg = f"""
<p><span class="user-mention" data-user-id="{hamlet.id}">@King Hamlet</span> subscribed you to the channel <a class="stream" data-stream-id="{stream_invite_only_1.id}" href="/#narrow/channel/{stream_invite_only_1.id}-{stream_invite_only_1.name}">#{stream_invite_only_1.name}</a>.</p>
<p><span class="user-mention silent" data-user-id="{hamlet.id}">King Hamlet</span> subscribed you to <a class="stream" data-stream-id="{stream_invite_only_1.id}" href="/#narrow/channel/{stream_invite_only_1.id}-{stream_invite_only_1.name}">#{stream_invite_only_1.name}</a>.</p>
"""
for user in [cordelia, othello, polonius]:
self.assert_user_got_subscription_notification(user, msg)

View File

@@ -572,14 +572,14 @@ def you_were_just_subscribed_message(
subscriptions = sorted(stream_names)
if len(subscriptions) == 1:
with override_language(recipient_user.default_language):
return _("{user_full_name} subscribed you to the channel {channel_name}.").format(
user_full_name=f"@**{acting_user.full_name}|{acting_user.id}**",
return _("{user_full_name} subscribed you to {channel_name}.").format(
user_full_name=silent_mention_syntax_for_user(acting_user),
channel_name=f"#**{subscriptions[0]}**",
)
with override_language(recipient_user.default_language):
message = _("{user_full_name} subscribed you to the following channels:").format(
user_full_name=f"@**{acting_user.full_name}|{acting_user.id}**",
user_full_name=silent_mention_syntax_for_user(acting_user),
)
message += "\n\n"
for channel_name in subscriptions: