conversejs / converse.js

Web-based XMPP/Jabber chat client written in JavaScript
http://conversejs.org
Mozilla Public License 2.0
3.04k stars 763 forks source link

XEP-0045 ambiguity concerning "visitor" role in unmoderated rooms #3428

Open JohnXLivingston opened 1 week ago

JohnXLivingston commented 1 week ago

Describe the bug

XEP-0045 MUC considers that the "visitor" role is related to the room "moderated" option. But the XEP is not very clear about what we should do when an occupant has "visitor" role on an unmoderated room.

There is just this, somewhere hidden in the middle of the XEP: "** An implementation MAY grant voice by default to visitors in unmoderated rooms."

If we test with the Prosody server, and with ConverseJS as client, we can do "/mute XXX" in an unmoderated room. This will indeed set the occupant as "visitor", and bounce all his messages.

But in such case, ConverseJS does not disable the message field. This is because of this part of the code:

canPostMessages () {
  return this.isEntered() && !(this.features.get('moderated') && this.getOwnRole() === 'visitor');
}

I think we should remove the test on this.features.get('moderated').

To Reproduce Steps to reproduce the behavior:

  1. Join an unmoderated room with 2 accounts: one owner, the other just participant (on a Prosody server)
  2. With the owner, do /mute the_other_account
  3. See that the participant is now visitor, and that if he tries to send a message, Prosody will bounce it.

Expected behavior

Message field should be disabled for the visitor.

Neustradamus commented 1 week ago

To follow this ticket