Simplify validation logic

(imported from commit aec56185fae88c3c51611a15fc11d44fa120951e)
This commit is contained in:
Keegan McAllister 2012-10-03 16:55:27 -04:00
parent d619618fed
commit 534cf77265
1 changed files with 6 additions and 12 deletions

View File

@ -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))