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: Add id to user mentions for stream notifications.

Steve Howellfd925e6045d9
diff --git a/zerver/tests/test_subs.py b/zerver/tests/test_subs.py
index 43b30ef2a34..0f0f3071862 100644
--- a/zerver/tests/test_subs.py
+++ b/zerver/tests/test_subs.py
@@ -4945,6 +4945,7 @@ class GetSubscribersTest(ZulipTestCase):
(We also use this test to verify subscription notifications to
folks who get subscribed to streams.)
"""
+ hamlet = self.example_user("hamlet")
streams = [f"stream_{i}" for i in range(10)]
for stream_name in streams:
self.make_stream(stream_name)
@@ -4958,8 +4959,8 @@ class GetSubscribersTest(ZulipTestCase):
self.user_profile, streams, dict(principals=orjson.dumps(users_to_subscribe).decode())
)
- msg = """
- @**King Hamlet** subscribed you to the following streams:
+ msg = f"""
+ @**King Hamlet|{hamlet.id}** subscribed you to the following streams:
* #**stream_0**
* #**stream_1**
@@ -4992,8 +4993,8 @@ class GetSubscribersTest(ZulipTestCase):
invite_only=True,
)
- msg = """
- @**King Hamlet** subscribed you to the stream #**stream_invite_only_1**.
+ msg = f"""
+ @**King Hamlet|{hamlet.id}** subscribed you to the stream #**stream_invite_only_1**.
"""
self.assert_user_got_subscription_notification(msg, self.user_profile.realm)
diff --git a/zerver/views/streams.py b/zerver/views/streams.py
index f79ef1eab90..f379e6d716a 100644
--- a/zerver/views/streams.py
+++ b/zerver/views/streams.py
@@ -443,13 +443,13 @@ def you_were_just_subscribed_message(
if len(subscriptions) == 1:
with override_language(recipient_user.default_language):
return _("{user_full_name} subscribed you to the stream {stream_name}.").format(
- user_full_name=f"@**{acting_user.full_name}**",
+ user_full_name=f"@**{acting_user.full_name}|{acting_user.id}**",
stream_name=f"#**{subscriptions[0]}**",
)
with override_language(recipient_user.default_language):
message = _("{user_full_name} subscribed you to the following streams:").format(
- user_full_name=f"@**{acting_user.full_name}**",
+ user_full_name=f"@**{acting_user.full_name}|{acting_user.id}**",
)
message += "\n\n"
for stream_name in subscriptions: