diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-03-25 09:59:39 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-03-25 10:29:55 +0200 |
commit | 91ae507663ade7a4524f9d3d5db49b556a3fa048 (patch) | |
tree | 57df5d143d2cbc2a36f0ab3b56d3af57f8ed11aa | |
parent | 3743054aebe8611db09020b784817b54baeae545 (diff) | |
download | jitsi-91ae507663ade7a4524f9d3d5db49b556a3fa048.zip jitsi-91ae507663ade7a4524f9d3d5db49b556a3fa048.tar.gz jitsi-91ae507663ade7a4524f9d3d5db49b556a3fa048.tar.bz2 |
Fixes duplicate source contacts, when receiving new one check for existing.
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java index 02e181b..9ab552a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/TreeContactList.java @@ -228,7 +228,16 @@ public class TreeContactList return; UIContact uiContact - = sourceUI.createUIContact(sourceContact); + = sourceUI.getUIContact(sourceContact); + + if(uiContact != null) + { + // UI contact is already existing, just update it + contactChanged(sourceContact, uiContact, sourceUI); + return; + } + + uiContact = sourceUI.createUIContact(sourceContact); // ExtendedContactSourceService has already matched the // SourceContact over the pattern @@ -321,6 +330,21 @@ public class TreeContactList return; } + contactChanged(sourceContact, uiContact, sourceUI); + } + + /** + * To indicate contact changed to an existing UIContact. + * Used from contactChanged and from contactReceived, when the UIContact + * already exist. + * @param sourceContact the contact triggering the event + * @param uiContact the existing UIContact + * @param sourceUI the contact source service UI representation + */ + private void contactChanged(SourceContact sourceContact, + UIContact uiContact, + UIContactSource sourceUI) + { if(!(uiContact instanceof UIContactImpl)) return; |