mirror of https://github.com/zulip/zulip.git
can_post_messages_in_stream: Add condition check for archived streams.
Prevents users from sending any message in an archived stream.
This commit is contained in:
parent
7e97358c35
commit
4b90741f91
|
@ -568,6 +568,10 @@ export function can_unsubscribe_others(sub: StreamSubscription): boolean {
|
|||
}
|
||||
|
||||
export function can_post_messages_in_stream(stream: StreamSubscription): boolean {
|
||||
if (stream.is_archived) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (page_params.is_spectator) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1116,6 +1116,9 @@ test("can_post_messages_in_stream", ({override}) => {
|
|||
|
||||
page_params.is_spectator = true;
|
||||
assert.equal(stream_data.can_post_messages_in_stream(social), false);
|
||||
|
||||
social.is_archived = true;
|
||||
assert.equal(stream_data.can_post_messages_in_stream(social), false);
|
||||
});
|
||||
|
||||
test("can_unsubscribe_others", ({override}) => {
|
||||
|
|
Loading…
Reference in New Issue