mirror of https://github.com/zulip/zulip.git
Simplify validation logic
(imported from commit aec56185fae88c3c51611a15fc11d44fa120951e)
This commit is contained in:
parent
d619618fed
commit
534cf77265
|
@ -24,19 +24,13 @@ $(function () {
|
|||
|
||||
// If validation fails, the validate function will pop up
|
||||
// an error message.
|
||||
if (composing_huddle_message()) {
|
||||
if (!validate_huddle_message()) {
|
||||
return false;
|
||||
}
|
||||
// We have nothing else to check.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (composing_class_message()) {
|
||||
if (!validate_class_message()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// For huddles, all the logic is in validate_huddle_message.
|
||||
if (composing_huddle_message())
|
||||
return validate_huddle_message();
|
||||
|
||||
if (composing_class_message() && !validate_class_message())
|
||||
return false;
|
||||
|
||||
var zephyr_class = compose_class_name();
|
||||
if (!check_class_for_send(zephyr_class))
|
||||
|
|
Loading…
Reference in New Issue