Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XEP-0045: Cannot distinguish between empty subject and no subject #167

Open
ivucica opened this issue Aug 25, 2020 · 1 comment
Open

XEP-0045: Cannot distinguish between empty subject and no subject #167

ivucica opened this issue Aug 25, 2020 · 1 comment

Comments

@ivucica
Copy link

ivucica commented Aug 25, 2020

Hi,

per https://xmpp.org/extensions/xep-0045.html#enter-subject an empty subject is permitted and necessary to complete the join process in case of no subject being specified.

If there is no subject set, the room MUST return an empty <subject/> element.

However, in the Message stanza, Subject field is a plain string (not a pointer), and the xml: field tag contains ,omitempty.

This makes it night impossible to spot an empty-subject message (or, for that matter, an empty-but-present body message).

(It might be doable by using a custom MsgExtension and doing a Get() over it, but this is inconvenient, and if possible at all, I cannot quickly think of a way to do it, given that a global type registry is involved.)

An improvement would be to simply replace the string with a *string, and evaluating whether to use omitempty.

@ivucica
Copy link
Author

ivucica commented Aug 25, 2020

Additionally, empty vs non-present <body/> is relevant for XEP-0045:

Note: In accordance with the core definition of XML stanzas, any message can contain a <subject/> element; only a message that contains a <subject/> but no <body/> element shall be considered a subject change for MUC purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant