Fix a bug which makes conference contacts appearing twice in the ChatContactListModel.

cusax-fix
Valentin Martinet 16 years ago
parent e0cb66f1eb
commit 007a5c657d

@ -22,6 +22,7 @@
*
* @author Yana Stamcheva
* @author Lubomir Marinov
* @author Valentin Martinet
*/
public class ConferenceChatSession
implements ChatSession,
@ -418,26 +419,16 @@ public void memberPresenceChanged(ChatRoomMemberPresenceChangeEvent evt)
if (eventType.equals(ChatRoomMemberPresenceChangeEvent.MEMBER_JOINED))
{
// // Check if not ever present in the chat room. In some cases, the
// // considered chatroom member may appear twice in the chat contact
// // list panel.
// for(int i=0; i<chatParticipants.size(); i++)
// {
// ChatContact cc = chatParticipants.get(i);
// if(((ChatRoomMember)cc.getDescriptor()).getContactAddress()
// .equals(evt.getChatRoomMember().getContactAddress()))
// {
// chatParticipants.remove(i);
// sessionRenderer.removeChatContact(cc);
// }
// }
ConferenceChatContact chatContact
= new ConferenceChatContact(chatRoomMember);
chatParticipants.add(chatContact);
sessionRenderer.addChatContact(chatContact);
// Check if not ever present in the chat room. In some cases, the
// considered chatroom member may appear twice in the chat contact
// list panel.
for(ChatContact cc : chatParticipants)
if(!cc.getUID().equals(chatContact.getUID()))
chatParticipants.add(chatContact);
sessionRenderer.addChatContact(chatContact);
/*
* When the whole list of members of a given chat room is reported,

Loading…
Cancel
Save