mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Merge pull request #467 from Flowdalic/4.4-data-forms
Proposed data form updates for 4.4
This commit is contained in:
commit
899813a668
1 changed files with 7 additions and 4 deletions
|
@ -59,7 +59,13 @@ public class FillableForm extends FilledForm {
|
|||
if (formField.isRequired()) {
|
||||
String fieldName = formField.getFieldName();
|
||||
requiredFields.add(fieldName);
|
||||
missingRequiredFields.add(fieldName);
|
||||
|
||||
if (formField.hasValueSet()) {
|
||||
// This is a form field with a default value.
|
||||
write(formField);
|
||||
} else {
|
||||
missingRequiredFields.add(fieldName);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.requiredFields = Collections.unmodifiableSet(requiredFields);
|
||||
|
@ -224,9 +230,6 @@ public class FillableForm extends FilledForm {
|
|||
if (!getDataForm().hasField(fieldName)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (filledFields.containsKey(fieldName)) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
// Perform validation, e.g. using XEP-0122.
|
||||
// TODO: We could also perform list-* option validation, but this has to take xep122's <open/> into account.
|
||||
|
|
Loading…
Reference in a new issue