compose.js: Remove small piece of dead code.

In this commit we remove a small piece of dead code from
check_stream_for_send() function and also rename it to
check_unsubscribed_stream_for_send() which makes more sense.
This commit is contained in:
Aditya Bansal 2017-06-28 16:47:10 +05:30 committed by showell
parent 89090cd3af
commit 84b52661bb
1 changed files with 3 additions and 5 deletions

View File

@ -443,15 +443,12 @@ exports.get_invalid_recipient_emails = function () {
return invalid_recipients; return invalid_recipients;
}; };
function check_stream_for_send(stream_name, autosubscribe) { function check_unsubscribed_stream_for_send(stream_name, autosubscribe) {
var stream_obj = stream_data.get_sub(stream_name); var stream_obj = stream_data.get_sub(stream_name);
var result; var result;
if (!stream_obj) { if (!stream_obj) {
return "does-not-exist"; return "does-not-exist";
} }
if (stream_obj.subscribed) {
return "subscribed";
}
if (!autosubscribe) { if (!autosubscribe) {
return "not-subscribed"; return "not-subscribed";
} }
@ -515,7 +512,8 @@ exports.validate_stream_message_address_info = function (stream_name) {
var response; var response;
switch (check_stream_for_send(stream_name, page_params.narrow_stream !== undefined)) { switch (check_unsubscribed_stream_for_send(stream_name,
page_params.narrow_stream !== undefined)) {
case "does-not-exist": case "does-not-exist":
response = "<p>The stream <b>" + response = "<p>The stream <b>" +
Handlebars.Utils.escapeExpression(stream_name) + "</b> does not exist.</p>" + Handlebars.Utils.escapeExpression(stream_name) + "</b> does not exist.</p>" +