OF-2308: Prevent MUC nickname change to reserved nickname
When another user reserved a nickname in a MUC, another user should not be able to change its nickname to that reserved value after joining the room.
OF-2305: Do not treat nickname change as a join
Openfire tries to accomodate clients that think that they're no longer in the room, while they are. Sadly, this code does not distinguish between that scenario, and a scenario in which a client triest to change a nickname in the room. This commit adds that differentation.
OF-2307: Allow nickname change to existing nickname of same user
When a user is joined a room with two different nicknames, it should be allowed to rename one of its nicknames into the other, without a conflict being raised.
OF-2304: Non-MUC-occupants should not be able to change nicknames
The code that detects if the requestor of a nickname change is an occupant in the room needs fixing.
Many thanks to @MightyMop for identifying this problem and suggesting a fix.
OF-2293: Prevent duplicate MUC occupants from existing
This commit prevents an occupant to be added to a room that already has that same occupant. This has been observed in the wild (while testing new MUC/Clustering code).
The changes in this commit do not take away the cause of the duplicated addition, which are unknown at this time. The change does take away the direct event (preventing the duplicate from being added), and logs an error message that contains a stack trace. Hopefully that can be used in the future to find the cause of the issue.