mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
stream_data: Add web_public as a stream privacy mode.
Show web_public descriptions for web public streams. (Temporarily limited to development environments, since this feature is not available yet).
This commit is contained in:
@@ -129,6 +129,17 @@ export const stream_privacy_policy_values = {
|
||||
},
|
||||
};
|
||||
|
||||
if (page_params.development_environment) {
|
||||
stream_privacy_policy_values.web_public = {
|
||||
code: "web-public",
|
||||
name: $t({defaultMessage: "Web public"}),
|
||||
description: $t({
|
||||
defaultMessage:
|
||||
"Anyone can join; anyone on the Internet can view complete message history without creating an account",
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
export const stream_post_policy_values = {
|
||||
everyone: {
|
||||
code: 1,
|
||||
@@ -544,6 +555,9 @@ export function id_is_subscribed(stream_id) {
|
||||
export function get_stream_privacy_policy(stream_id) {
|
||||
const sub = sub_store.get(stream_id);
|
||||
|
||||
if (sub.is_web_public) {
|
||||
return stream_privacy_policy_values.web_public.code;
|
||||
}
|
||||
if (!sub.invite_only) {
|
||||
return stream_privacy_policy_values.public.code;
|
||||
}
|
||||
@@ -553,6 +567,11 @@ export function get_stream_privacy_policy(stream_id) {
|
||||
return stream_privacy_policy_values.private_with_public_history.code;
|
||||
}
|
||||
|
||||
export function is_web_public(stream_id) {
|
||||
const sub = sub_store.get(stream_id);
|
||||
return sub !== undefined && sub.is_web_public;
|
||||
}
|
||||
|
||||
export function get_invite_only(stream_name) {
|
||||
const sub = get_sub(stream_name);
|
||||
if (sub === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user