if( ! contact.isInChatWindow() || settings.oneChatWindowPerChatPartner){
contact.setIsInChatWindow(true);
if(settings.oneChatWindowPerChatPartner){
ChatWindowInterface chatWindow = new ChatWindow(new Rectangle(settings.chatWindowBounds.x,
settings.chatWindowBounds.y,
settings.chatWindowBounds.width,
settings.chatWindowBounds.height), this);
chatWindows.add(chatWindow);
chatWindow.addContact(contact);
}else{
if(chatWindows.size() > 0){
chatWindows.get(chatWindows.size() - 1).addContact(contact);
}else{
ChatWindowInterface chatWindow = new ChatWindow(new Rectangle(settings.chatWindowBounds.x,
settings.chatWindowBounds.y,
settings.chatWindowBounds.width,
settings.chatWindowBounds.height), this);
chatWindows.add(chatWindow);
chatWindow.addContact(contact);
}
}
}
}