MUC affiliation changes not broadcasted to clients

When a user’s affiliation changes in a MUC room (e.g. from none to moderator) and that user is currently in the room, its affiliation change is not being broadcasted to the room occupants. While the new affiliation is correctly applied (he has the powers of the new affiliation level like kicking users etc.), clients are not informed by the server about the change.

Usually, clients will indiacte a user’s affiliation with different icons for owners, moderators, members and visitors. If affiliation changes are not broadcasted, clients won’t update their display and might even prevent administrative commands in their UI if they think the user isn’t allowed that command at his apparent affiliation level.

If the user leaves and rejoins the MUC room, the correct affiliation is broadcasted.

This happens with affiliation changes triggered from the Admin GUI and the REST API, so I assume it happens regardless of what triggers the affiliation change. When looking into this issue, please make sure a fix would be applied centrally so that it applies regardless of what triggered the affiliation change.

** Edit: The XEP-0045: Multi-User Chat says in “5.2.2 Changing Affiliations”:

Sometimes the change results from the user’s own action (e.g., registering as a member of the room), whereas sometimes the change results from an action taken by an admin or owner. If a user’s affiliation changes, a MUC service implementation MUST change the user’s affiliation to reflect the change and communicate that to all occupants (if the room is configured to broadcast presence from entities with a given role).

** Edit2: I think I found the bug. I tested with Adium (libpurple) and Psi on Mac. Both do not update the user affiliation if I change it in the Openfire Admin Console. I see a packet from the Server in the client’s XML Console though. This packet always contains the affiliation the user had when he joined the channel, NOT the new one! Here, I just removed the user’s owner affiliation and this is what Openfire broadcasts:

<item affiliation=“owner” role=“moderator”/>

I think i’ve seen something similar while testing Spark’s issue with not showing affiliation icons. Have you tested this with 4.0.3 version?

Filed as OF-1176 (for now for 4.0.2, until confirmed for 4.0.3).

After a bit of testing i can confirm that affiliation is not updating dynamically (only after a user rejoins the room). But earlier today i was testing this against 4.1 alpha ( xmpp server) and it was updating dynamically (for the most part).

4.1 updates owner, admin, and membership instantly, but it is not possible to grant Moderator only role and it also usually not possible to revoke/grant voice.

Moderator and Voice state only changes when user’s presence changes (say from Online to Away or vice versa). Again, with 4.1.

Thanks for looking into this!

Yes, I can confirm: my observations were on a fresh 4.0.3.