Skip to content

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

@ivucica

Description

@ivucica

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions