mention: Handle mentioning deactivated user groups.

If someone tries to mention a deactivated user group,
then it is automatically converted to a silent mention
like we do for deactivated users.
This commit is contained in:
Sahil Batra
2024-06-19 16:21:20 +05:30
committed by Tim Abbott
parent c1d6da0a5c
commit fef2925ff0
2 changed files with 25 additions and 1 deletions

View File

@@ -1957,6 +1957,9 @@ class UserGroupMentionPattern(CompiledInlineProcessor):
if db_data is not None:
user_group = db_data.mention_data.get_user_group(name)
if user_group:
if user_group.deactivated:
silent = True
if not silent:
self.zmd.zulip_rendering_result.mentions_user_group_ids.add(user_group.id)
name = user_group.name