}
message += " has entered the room";
window.serverNoticeMessage(message);
PluginChain.fireEvent(new MUCEvent(buddy.getUser(),
MUCEvent.EVENT_PARTICIPANT_JOINED, "",
new Date()));
} else if (nickChange != null) {
nickChange.setIsInRoom(false);
window.serverNoticeMessage(nickChange.getName()
+ " is now known as " + buddy.getName());
window.removeBuddy(nickChange.getUser());
}
buddy.setIsInRoom(true);
nickChange = null;
} else if (presence.getType() == Presence.Type.UNAVAILABLE) {
buddy.setIsInRoom(false);
window.getBuddyStatuses().remove(buddy);
String leaveMessage = buddy.getName()
+ " has left the room";
PluginChain.fireEvent(new MUCEvent(buddy.getUser(),
MUCEvent.EVENT_PARTICIPANT_PARTED, "", new Date()));
if (presence.getStatus() != null
&& !presence.getStatus().equals("")) {
leaveMessage += ": " + presence.getStatus();