Commit 7effdb23 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed problem when renaming occupant's nickname. JM-186


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1027 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3540a9e7
...@@ -1247,10 +1247,14 @@ public class MUCRoomImpl implements MUCRoom { ...@@ -1247,10 +1247,14 @@ public class MUCRoomImpl implements MUCRoom {
public void nicknameChanged(String oldNick, String newNick) { public void nicknameChanged(String oldNick, String newNick) {
// Associate the existing MUCRole with the new nickname // Associate the existing MUCRole with the new nickname
occupants.put(newNick.toLowerCase(), occupants.get(oldNick.toLowerCase())); MUCRole occupant = occupants.get(oldNick.toLowerCase());
// Check that we still have an occupant for the old nickname
if (occupant != null) {
occupants.put(newNick.toLowerCase(), occupant);
// Remove the old nickname // Remove the old nickname
occupants.remove(oldNick.toLowerCase()); occupants.remove(oldNick.toLowerCase());
} }
}
public void changeSubject(Message packet, MUCRole role) throws ForbiddenException { public void changeSubject(Message packet, MUCRole role) throws ForbiddenException {
if ((canOccupantsChangeSubject() && role.getRole().compareTo(MUCRole.Role.visitor) < 0) || if ((canOccupantsChangeSubject() && role.getRole().compareTo(MUCRole.Role.visitor) < 0) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment