mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
realm: Replace allow_message_deleting with delete_own_message_policy.
This commit replaces 'allow_message_deleting' boolean setting with an integer setting 'delete_own_message_policy'. We have a separate dropdown now for deciding which user-roles can delete messages sent by themselves and the time-limit setting droddown is different. This new setting has two options - everyone and admins only. Other options including moderators will be added further. We also remove the "Never" option from the original time-limit dropdown, as admins are always allowed to delete message. This never option resembled the case of only admins being allowed to delete but this state is now resembled by setting the dropdown to "admins only" and we also disable the time-limit dropdown in this case as admins are allowed to delete irrespective of limit. Note, this setting is only for deleting messages sent by the deleting user themselves, and only admins are allowed to delete messages sent by others as before.
This commit is contained in:
@@ -28,6 +28,7 @@ import * as overlays from "./overlays";
|
||||
import {page_params} from "./page_params";
|
||||
import * as resize from "./resize";
|
||||
import * as rows from "./rows";
|
||||
import * as settings_config from "./settings_config";
|
||||
import * as settings_data from "./settings_data";
|
||||
import * as stream_bar from "./stream_bar";
|
||||
import * as stream_data from "./stream_data";
|
||||
@@ -167,7 +168,10 @@ export function get_deletability(message) {
|
||||
if (message.locally_echoed) {
|
||||
return false;
|
||||
}
|
||||
if (!page_params.realm_allow_message_deleting) {
|
||||
if (
|
||||
page_params.realm_delete_own_message_policy ===
|
||||
settings_config.delete_own_message_policy_values.by_admins_only.code
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user