Commit graph

8 commits

Author SHA1 Message Date
mb
3d52905fe9 fix check for childen and attributes in desc element 2024-06-18 15:49:27 +00:00
mb
a1bee56ee1 Support desc element in field
From [XEP-0004: Data Forms](https://xmpp.org/extensions/xep-0004.html#protocol-field):

> ...
> The <field/> element MAY contain any of the following child elements:
>
> <desc/>
> The XML character data of this element provides a natural-language
> description of the field, intended for presentation in a
> user-agent (e.g., as a "tool-tip", help button, or explanatory text
> provided near the field). The <desc/> element SHOULD NOT contain
> newlines (the \n and \r characters), since layout is the
> responsibility of a user agent, and any handling of
> newlines (e.g., presentation in a user interface) is unspecified
> herein. (Note: To provide a description of a field, it
> is RECOMMENDED to use a <desc/> element rather than
> a separate <field/> element of type "fixed".)
> ...
2024-06-18 15:07:03 +00:00
mb
ac0707e52d
Make ‘var’ attribute of a Field optional
Looking at [the spec](https://xmpp.org/extensions/xep-0004.html#protocol-field)
it seems valid not to have a `var` attribute set, at least for fields of type
`fixed` that is:

> If the element type is anything other than "fixed" (see below), it MUST
> possess a 'var' attribute that uniquely identifies the field in the context
> of the form (if it is "fixed", it MAY possess a 'var' attribute). The element
> MAY possess a 'label' attribute that defines a human-readable name for the field.
2024-06-18 12:55:32 +02:00
Emmanuel Gil Peyrot
002c2803d4 Fix typos across the codebase (thanks codespell!) 2024-05-14 05:46:02 +00:00
Jonas Schäfer
4853776010 data_forms: ignore incorrect FORM_TYPE fields as per XEP-0068
Some checks failed
Build / lint (push) Has been cancelled
Build / test-stable (push) Has been cancelled
Build / test-nightly (push) Has been cancelled
XEP-0068 is rather explicit that `FORM_TYPE` fields which are not
`type='hidden'` MUST be ignored (in most cases, see comments inside
the code for exceptions). The previous implementation returned an error
instead (and aborted parsing with that), which is obviously not
"ignoring".
2024-05-13 19:56:56 +00:00
4089891f6c Update edition to 2021
- Remove TryFrom/Into and FromIterator imports
- Prevent impl_validator_using_provider macro in sasl crate from
  constructing trait object

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-12-15 19:40:09 +00:00
Emmanuel Gil Peyrot
1cc16e65db dataforms: Add helper constructors for Field and DataForm. 2022-01-03 11:53:52 +01:00
Emmanuel Gil Peyrot
9410849d7a Rename the xmpp-parsers directory to parsers
This doesn’t change anything to the name of the crate, just makes
autocompletion easier by not sharing the same prefix as the xmpp crate.
2021-10-11 08:24:16 +02:00
Renamed from xmpp-parsers/src/data_forms.rs (Browse further)