compose: Update some comments on private stream warnings.

This commit is contained in:
Tim Abbott 2020-01-14 13:23:27 -08:00
parent c2af2c1fd1
commit 80b9acd745
1 changed files with 14 additions and 8 deletions

View File

@ -796,9 +796,10 @@ exports.render_and_show_preview = function (preview_spinner, preview_content_box
}; };
exports.warn_if_private_stream_is_linked = function (linked_stream) { exports.warn_if_private_stream_is_linked = function (linked_stream) {
// For PMs, we don't warn about links to private streams, since // For PMs, we currently don't warn about links to private
// you are often specifically encouraging somebody to subscribe // streams, since you are specifically sharing the existence of
// to the stream over PMs. // the private stream with someone. One could imagine changing
// this policy if user feedback suggested it was useful.
if (compose_state.get_message_type() !== 'stream') { if (compose_state.get_message_type() !== 'stream') {
return; return;
} }
@ -812,16 +813,21 @@ exports.warn_if_private_stream_is_linked = function (linked_stream) {
// If the stream we're linking to is not invite-only, then it's // If the stream we're linking to is not invite-only, then it's
// public, and there is no need to warn about it, since all // public, and there is no need to warn about it, since all
// users can already see all the public streams. // members can already see all the public streams.
//
// Theoretically, we could still do a warning if there are any
// guest users subscribed to the stream we're posting to; we may
// change this policy if user feedback suggests it'd be an
// improvement.
if (!linked_stream.invite_only) { if (!linked_stream.invite_only) {
return; return;
} }
if (stream_data.is_subscriber_subset(compose_stream, linked_stream)) { if (stream_data.is_subscriber_subset(compose_stream, linked_stream)) {
// Don't warn if subscribers list of current // Don't warn if subscribers list of current compose_stream is
// compose_stream is a subset of linked_stream's // a subset of linked_stream's subscribers list, because
// subscribers list, because everyone will be // everyone will be subscribed to the linked stream and so
// subscribed to the linked stream. // knows it exists.
return; return;
} }