mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
streams: Add API endpoint to get stream email.
This commit adds new API endpoint to get stream email which is used by the web-app as well to get the email when a user tries to open the stream email modal. The stream email is returned only to the users who have access to it. Specifically for private streams only subscribed users have access to its email. And for public streams, all non-guest users and only subscribed guests have access to its email. All users can access email of web-public streams.
This commit is contained in:
committed by
Alex Vandiver
parent
432001656e
commit
3c8701ee36
@@ -502,6 +502,13 @@ export function can_toggle_subscription(sub: StreamSubscription): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function can_access_stream_email(sub: StreamSubscription): boolean {
|
||||
return (
|
||||
(sub.subscribed || sub.is_web_public || (!page_params.is_guest && !sub.invite_only)) &&
|
||||
!page_params.is_spectator
|
||||
);
|
||||
}
|
||||
|
||||
export function can_access_topic_history(sub: StreamSubscription): boolean {
|
||||
// Anyone can access topic history for web-public streams and
|
||||
// subscriptions; additionally, members can access history for
|
||||
|
||||
Reference in New Issue
Block a user