mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
stream notifications: Add helper for silent user mention syntax.
In many of our stream notification messages, we make use of the same silent user mention syntax, the template for which was always hardcoded. This commit adds a helper function that all relevant callers can call to get the right syntax when mentioning users. Thanks to Tim Abbott for this suggestion!
This commit is contained in:
@@ -152,3 +152,7 @@ def get_stream_name_info(realm: Realm, stream_names: Set[str]) -> Dict[str, Full
|
||||
|
||||
dct = {row["name"]: row for row in rows}
|
||||
return dct
|
||||
|
||||
|
||||
def silent_mention_syntax_for_user(user_profile: UserProfile) -> str:
|
||||
return f"@_**{user_profile.full_name}|{user_profile.id}**"
|
||||
|
||||
Reference in New Issue
Block a user