mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
message_delete: Remove explicit is_spectator condition.
Removes explicit `is_spectator` condition when checking if message can deleted as it is checked by `user_has_permission_for_group_setting` function.
This commit is contained in:
@@ -48,7 +48,6 @@ import * as message_store from "./message_store.ts";
|
||||
import type {Message} from "./message_store.ts";
|
||||
import * as message_viewport from "./message_viewport.ts";
|
||||
import * as onboarding_steps from "./onboarding_steps.ts";
|
||||
import {page_params} from "./page_params.ts";
|
||||
import * as people from "./people.ts";
|
||||
import * as resize from "./resize.ts";
|
||||
import * as rows from "./rows.ts";
|
||||
@@ -236,10 +235,6 @@ export function is_message_sent_by_my_bot(message: Message): boolean {
|
||||
}
|
||||
|
||||
export function get_deletability(message: Message): boolean {
|
||||
if (page_params.is_spectator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (message.type === "stream" && stream_data.is_stream_archived(message.stream_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ export function get_actions_popover_content_context(message_id: number): ActionP
|
||||
|
||||
const conversation_time_url = hash_util.by_conversation_and_time_url(message);
|
||||
|
||||
const should_display_delete_option = message_edit.get_deletability(message) && not_spectator;
|
||||
const should_display_delete_option = message_edit.get_deletability(message);
|
||||
const should_display_read_receipts_option = realm.realm_enable_read_receipts && not_spectator;
|
||||
const should_display_remind_me_option = not_spectator;
|
||||
|
||||
|
||||
@@ -216,9 +216,6 @@ run_test("get_deletability", ({override}) => {
|
||||
sender_id: 1,
|
||||
};
|
||||
|
||||
page_params.is_spectator = true;
|
||||
assert.equal(message_edit.get_deletability(message), false);
|
||||
|
||||
page_params.is_spectator = false;
|
||||
|
||||
// User can delete any message
|
||||
|
||||
Reference in New Issue
Block a user