[formtypes] Clarify FORM_TYPE field type on 'submit' type forms
Since 'submit' type forms are allowed to omitt the explicit declartion
of the form field type, we must specify that the special FORM_TYPE
field in 'submit' forms may not carry a type declartion.
This just reflects what it is done in the wild anyways.
Co-authored-by: Marvin W <git@larma.de>
master
Florian Schmaus3 years agocommitted byJonas Schäfer
<p>These are forms that do not have a hidden field of name FORM_TYPE.
<p>These are forms with type="form" or type="result"that do not have a hidden field of name FORM_TYPE or forms with type="submit" that do not have any field of name FORM_TYPE.
Existing processing rules still apply.</p>
<examplecaption='Message with no FORM_TYPE'><![CDATA[
<p>If the FORM_TYPE field is not hidden, it MUST be ignored as a context indicator.</p>
<p>If the FORM_TYPE field is not hidden in a form with type="form" or type="result", it MUST be ignored as a context indicator.</p>
<examplecaption='Message with bad FORM_TYPE'><![CDATA[
<p>The following example shows a user's interaction with a Multi-User Chat room in order to register with the room.</p>
<p>The following example shows a user's interaction with a Multi-User Chat room in order to register with the room. Note that as per &xep0004; the form field "type" attribute may be omitted in data forms of type "submit".</p>
<p>If the FORM_TYPE field is not type="hidden", it does not have the special meaning defined herein.</p>
<p>If the FORM_TYPE field is not type="hidden" in a data form with type "form" or type "result", it does not have the special meaning defined herein. Data forms with the type "submit" are free to omit any explicit field type declaration (as per &xep0004; § 3.2), as the type is implied by the corresponding "form"-type data form. As consequence, implementations MUST treat a FORM_TYPE field without an explicit type attribute, in data forms of type "submit", as the FORM_TYPE field with the special meaning defined herein.</p>
<p>If the form is used in an IQ, the namespace of the <query/> element SHOULD match the base namespace of the FORM_TYPE. (One possible way of solving this problem would have been to reuse the <query/> tag from the IQ form of jabber:x:data within messages, but that would have meant that existing clients would not have been able to participate in these exchanges.)</p>