page_params: Add community_topic_editing_limit_seconds.

This was previously hardcoded with agreement between the Zulip backend
and frontend as 86400 seconds (1 day).  Now, it's still hardcoded in
the backend, but arranged in a way where we could add a setting
without any changes to the mobile and terminal apps to update logic.

Fixes #15278.
This commit is contained in:
Tim Abbott
2020-06-09 14:37:51 -07:00
parent 5deaae14b3
commit e242ddc848
5 changed files with 17 additions and 4 deletions

View File

@@ -47,9 +47,9 @@ function is_topic_editable(message, edit_limit_seconds_buffer) {
}
// If you're using community topic editing, there's a deadline.
// TODO: Change hardcoded value (24 hrs) to be realm setting. Currently, it is
// DEFAULT_COMMUNITY_TOPIC_EDITING_LIMIT_SECONDS
return 86400 + edit_limit_seconds_buffer + now.diffSeconds(message.timestamp * 1000) > 0;
return page_params.realm_community_topic_editing_limit_seconds
+ edit_limit_seconds_buffer
+ now.diffSeconds(message.timestamp * 1000) > 0;
}
function get_editability(message, edit_limit_seconds_buffer) {