mirror of https://github.com/zulip/zulip.git
compose: Fix bug on sending message to invalid streams.
The issue is that we were trying to validate the mentions before checking that the recipient stream was valid, leading to problems checking the membership of the stream. Fixes #3040.
This commit is contained in:
parent
c15d1ff343
commit
45a5e47e1b
|
@ -808,10 +808,6 @@ function validate_stream_message_address_info(stream_name) {
|
|||
"<p>Manage your subscriptions <a href='#subscriptions'>on your Streams page</a>.</p>";
|
||||
compose_error(response, $('#stream'));
|
||||
return false;
|
||||
case "subscribed":
|
||||
// You're actually subscribed to the stream, but this
|
||||
// browser window doesn't know it.
|
||||
return true;
|
||||
case "error":
|
||||
return false;
|
||||
case "not-subscribed":
|
||||
|
@ -841,8 +837,8 @@ function validate_stream_message() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!validate_stream_message_mentions(stream_name) ||
|
||||
!validate_stream_message_address_info(stream_name)) {
|
||||
if (!validate_stream_message_address_info(stream_name) ||
|
||||
!validate_stream_message_mentions(stream_name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue