Bug when banning user from MUC Room

Hi,

im not 100% sure but i think i found a bug in Openfire 3.10.2…

When i ban a user from a MUC Room with:

** **

** **

** –**

** **

** **

Openfire 3.9.3 replies with:

** **

** **

** **

** –**

** **

** **

** **

In Openfire 3.10.2 the sequence looks like the following:

** **

** **

** –**

** **

** **

reply…

** **

** **

** **

** **

Please note the missing affiliation in the presence and the missing status code. Additionally the user is actually not kicked immediately.

I think this is due to the following (from LocalMUCRoom.java line 1772)

if (isMembersOnly() && kickMember) {

** // If the room is members-only, remove the user from the room including a status**

** // code of 321 to indicate that the user was removed because of an affiliation change**

** // a status code of 301 indicates the user was removed as an outcast**

** for (Presence presence : thisOccupant) {**

** presence.setType(Presence.Type.unavailable);**

** presence.setStatus(null);**

** Element x = presence.getChildElement(“x”, “http://jabber.org/protocol/muc#user”);**

** if (reason != null && reason.trim().length() > 0) {**

** x.element(“item”).addElement(“reason”).setText(reason);**

** }**

** x.addElement(“status”).addAttribute(“code”, isOutcast ? “301” : “321”);**

** kickPresence(presence, senderRole.getUserAddress());**

** }**

** }**

The code actually only updates affiliation, add status code and kicks the user when the room is members only.

If i understand the muc xep correctly it should be also possible to ban users from rooms which are not members only.

Florian

Excellent bug report, I have filed it here: https://igniterealtime.org/issues/browse/OF-960

Do you still see this issue with Openfire 4.0.3 ?