mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
message_edit: Use move_messages_within_stream_limit_seconds in webapp.
We now use realm_move_messages_within_stream_limit_seconds setting in webapp to check topic edit permission replacing the 3-day limit. As was the case previously, there is no limit for admins and moderators.
This commit is contained in:
@@ -68,9 +68,14 @@ export function is_topic_editable(message, edit_limit_seconds_buffer = 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (page_params.realm_move_messages_within_stream_limit_seconds === null) {
|
||||
// This means no time limit for editing topics.
|
||||
return true;
|
||||
}
|
||||
|
||||
// If you're using community topic editing, there's a deadline.
|
||||
return (
|
||||
page_params.realm_community_topic_editing_limit_seconds +
|
||||
page_params.realm_move_messages_within_stream_limit_seconds +
|
||||
edit_limit_seconds_buffer +
|
||||
(message.timestamp - Date.now() / 1000) >
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user