From 71020bd233cb2e98ff88c3bfde714d30c10a2f41 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Fri, 23 Jun 2006 16:09:02 +0000 Subject: [PATCH] Make sure we don't override existing display name's with those of the first contact added to a meta contact --- .../sip/communicator/impl/contactlist/MetaContactImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactImpl.java index d8b355a0b..356e6a452 100644 --- a/src/net/java/sip/communicator/impl/contactlist/MetaContactImpl.java +++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactImpl.java @@ -287,8 +287,11 @@ void addProtoContact(Contact contact) this.protoContacts.add(contact); - //if this is our firt contact - set the display name too. - if(this.protoContacts.size() == 1){ + //if this is our firt contact and we don't already have a display + //name, use theirs. + if(this.protoContacts.size() == 1 + &&( this.displayName == null + || this.displayName.trim().length() == 0)){ //be careful not to use setDisplayName() here cause this will //bring us into a deadlock. this.displayName = new String(contact.getDisplayName().getBytes());