mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
message: Check wildcard mention restrictions while editing message.
This commit adds code to check whether a user is allowed to use wildcard mention in a large stream or not while editing a message based on the realm settings. Previously this was only checked while sending message, thus user was easily able to use wildcard mention by first sending a normal message and then using a wildcard mention by editing it.
This commit is contained in:
@@ -3068,6 +3068,13 @@ def check_update_message(
|
||||
)
|
||||
links_for_embed |= rendering_result.links_for_preview
|
||||
|
||||
if message.is_stream_message() and rendering_result.mentions_wildcard:
|
||||
stream = access_stream_by_id(user_profile, message.recipient.type_id)[0]
|
||||
if not wildcard_mention_allowed(message.sender, stream):
|
||||
raise JsonableError(
|
||||
_("You do not have permission to use wildcard mentions in this stream.")
|
||||
)
|
||||
|
||||
new_stream = None
|
||||
number_changed = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user