Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
reminder: Use pretty message link for reminder text.
Aman Agrawal68aefeafdd65
diff --git a/zerver/lib/reminders.py b/zerver/lib/reminders.pyindex 8a02142ddfb..582cd3d9f22 100644--- a/zerver/lib/reminders.py+++ b/zerver/lib/reminders.py@@ -5,7 +5,8 @@ from zerver.lib.markdown.fenced_code import get_unused_fencefrom zerver.lib.mention import silent_mention_syntax_for_userfrom zerver.lib.message import truncate_contentfrom zerver.lib.message_cache import MessageDict-from zerver.lib.url_encoding import near_message_url, topic_narrow_url+from zerver.lib.topic_link_util import get_message_link_syntax+from zerver.lib.url_encoding import near_message_urlfrom zerver.models import Message, Stream, UserProfile@@ -17,17 +18,13 @@ def get_reminder_formatted_content(message: Message, current_user: UserProfile)id=message.recipient.type_id,realm=current_user.realm,)- narrow_link = topic_narrow_url(- realm=current_user.realm,- stream=stream,- topic_name=message.topic_name(),- )- content = _(- "You requested a reminder for the following message sent to [{stream_name} > {topic_name}]({narrow_link})."- ).format(- stream_name=stream.name,- topic_name=message.topic_name(),- narrow_link=narrow_link,+ content = _("You requested a reminder for {message_pretty_link}.").format(+ message_pretty_link=get_message_link_syntax(+ stream_id=stream.id,+ stream_name=stream.name,+ topic_name=message.topic_name(),+ message_id=message.id,+ ))else:content = _("You requested a reminder for the following direct message.")diff --git a/zerver/tests/test_reminders.py b/zerver/tests/test_reminders.pyindex 233a79f1186..508188b575a 100644--- a/zerver/tests/test_reminders.py+++ b/zerver/tests/test_reminders.py@@ -61,7 +61,7 @@ class RemindersTest(ZulipTestCase):def get_channel_message_reminder_content(self, msg_content: str, msg_id: int) -> str:return (- "You requested a reminder for the following message sent to [Verona > test](http://zulip.testserver/#narrow/channel/3-Verona/topic/test).\n\n"+ f"You requested a reminder for #**Verona>test@{msg_id}**.\n\n"f"@_**King Hamlet|10** [said](http://zulip.testserver/#narrow/channel/3-Verona/topic/test/near/{msg_id}):\n```quote\n{msg_content}\n```")