Openfire MUC owner cannot reserve username
Description
Environment
Activity
Dan Caseley November 12, 2021 at 12:43 PM
Doing some reading about how this should work in the context of XEP-0045 ( )
An implementation MAY allow an unaffiliated user (in a moderated room, normally a participant) to register with a room; as a result, the user will become a member of the room and will have their preferred nickname reserved in the room.
This would suggest that an affiliated user might not be able to register? Is this a XEP problem?
If the desired room nickname is already reserved for that room, the room MUST return a <conflict/> error to the user
This sounds like we’re not returning the correct error message
If the user did not include a valid data form, the room MUST return a <bad-request/> error to the user
This sounds better (if the operation is indeed not allowed)
After the user submits the form, the service … MAY immediately add the user to the member list by changing the user's affiliation from "none" to "member"
We’re not at “none”, and it’s only a MAY. Maybe we can register an affiliated user and still be compliant, just with a check of a bare JID’s affiliation with the room, and skipping any affiliation change if one exists? We’d still need to send a positive result to the user, but probably no presence info would be required to the other users, unless a nick change also occurred AND the nicks are enforced.
Launch Openfire using demoboot
Log in to Spark using jane/secret
Using Spark's debug tools...
Create a MUC
Get the registration form
Register
The server returns a conflict. The offending line appears to be this:
https://github.com/igniterealtime/Openfire/blob/e665cd886bdc0ddf86ee54794d2a178fb4033fd6/xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/IQMUCRegisterHandler.java#L203
Regardless of your current role in the room, registering with the room (for the purposes of reserving your nickname) always tries to set you as a member.