Fixes ConcurrentModificationException in conference invite dialog. Fixes

showing entries for address book and outlook home address details in
conference invite dialog.
cusax-fix
yanas 13 years ago
parent 237c263e27
commit 24c22544b8

@ -1204,6 +1204,7 @@ private ContactDetail setCapabilities(
ProtocolNames.AIM);
break;
case kABEmailProperty:
supportedOpSets.add(OperationSetBasicTelephony.class);
break;
case kABICQInstantProperty:
supportedOpSets.add(OperationSetBasicInstantMessaging.class);

@ -9,6 +9,8 @@
import java.util.*;
import java.util.regex.*;
import org.jitsi.util.*;
import net.java.sip.communicator.service.contactsource.*;
import net.java.sip.communicator.service.protocol.*;
@ -217,7 +219,7 @@ public void initQueryResults()
= (SortedGenericSourceContact)
createSourceContact(sourceContact,
detail);
demuxContacts.add(demuxContact);
addContact(demuxContact);
}
}
}
@ -230,7 +232,10 @@ public void initQueryResults()
*/
public List<SourceContact> getQueryResults()
{
return new LinkedList<SourceContact>(demuxContacts);
synchronized (demuxContacts)
{
return new LinkedList<SourceContact>(demuxContacts);
}
}
public void cancel()
@ -272,7 +277,7 @@ public void contactReceived(ContactReceivedEvent event)
SourceContact demuxContact
= createSourceContact(sourceContact, detail);
demuxContacts.add(demuxContact);
addContact(demuxContact);
fireContactReceived(demuxContact);
}
@ -303,13 +308,31 @@ private SourceContact createSourceContact( SourceContact sourceContact,
sourceContact.getDisplayName(),
contactDetails);
genericContact.setDisplayDetails(sourceContact.getDisplayDetails());
String displayName = contactDetail.getDisplayName();
if (!StringUtils.isNullOrEmpty(displayName))
genericContact.setDisplayDetails(displayName);
else
genericContact.setDisplayDetails(contactDetail.getDetail());
genericContact.setPresenceStatus(sourceContact.getPresenceStatus());
genericContact.setImage(sourceContact.getImage());
return genericContact;
}
/**
* Adds a contact to the result list.
*
* @param demuxContact the <tt>SourceContact</tt> to add
*/
private void addContact(SourceContact demuxContact)
{
synchronized (demuxContacts)
{
demuxContacts.add(demuxContact);
}
}
/**
* Indicates that the status of a search has been changed.
*
@ -349,9 +372,12 @@ private boolean isPreferredContactDetail(ContactDetail c)
ProtocolProviderService preferredProvider
= c.getPreferredProtocolProvider(opSetClass);
if (preferredProvider == null
|| preferredProvider.equals(
preferredProtocolProviders.get(opSetClass)))
if (preferredProvider != null
&& preferredProvider.equals(
preferredProtocolProviders.get(opSetClass))
|| (preferredProvider == null
&& c.getSupportedOperationSets() != null
&& c.getSupportedOperationSets().contains(opSetClass)))
{
return true;
}

@ -5,5 +5,6 @@ Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
Import-Package: net.java.sip.communicator.service.contactsource,
net.java.sip.communicator.service.protocol,
org.jitsi.util,
org.osgi.framework
System-Bundle: yes

@ -194,8 +194,12 @@ else if(d instanceof VideoDetail)
ArrayList<ContactDetail> contactDetails
= new ArrayList<ContactDetail>();
String detailDisplayName
= pnd.getNumber() + "(" + localizedType + ")";
ContactDetail detail
= new ContactDetail(pnd.getNumber());
= new ContactDetail(pnd.getNumber(),
detailDisplayName);
ArrayList<Class<? extends OperationSet>>
supportedOpSets
= new ArrayList<Class<? extends OperationSet>>();
@ -211,8 +215,7 @@ else if(d instanceof VideoDetail)
getContactSource(),
contact,
contactDetails,
pnd.getNumber()
+ "(" + localizedType + ")");
detailDisplayName);
addQueryResult(numberSourceContact);
}

@ -8,6 +8,8 @@
import java.util.*;
import org.jitsi.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
@ -294,6 +296,11 @@ public static SubCategory fromString(String value)
*/
protected String contactDetailValue;
/**
* The display name of this detail.
*/
private String detailDisplayName;
/**
* The set of labels of this <tt>ContactDetail</tt>. The labels may be
* arbitrary and may include any of the standard/well-known labels defined
@ -328,7 +335,19 @@ public static SubCategory fromString(String value)
*/
public ContactDetail(String contactDetailValue)
{
this(contactDetailValue, null, null);
this(contactDetailValue, null, null, null);
}
/**
* Creates a <tt>ContactDetail</tt> by specifying the contact address,
* corresponding to this detail.
* @param contactDetailValue the contact detail value corresponding to this
* detail
* @param detailDisplayName the display name of this detail
*/
public ContactDetail(String contactDetailValue, String detailDisplayName)
{
this(contactDetailValue, detailDisplayName, null, null);
}
/**
@ -343,7 +362,24 @@ public ContactDetail(String contactDetailValue)
public ContactDetail( String contactDetailValue,
Category category)
{
this(contactDetailValue, category, null);
this(contactDetailValue, null, category, null);
}
/**
* Initializes a new <tt>ContactDetail</tt> instance which is to represent a
* specific contact address and which is to be optionally labeled with a
* specific set of labels.
*
* @param contactDetailValue the contact detail value to be represented by
* the new <tt>ContactDetail</tt> instance
* @param detailDisplayName the display name of this detail
* @param category
*/
public ContactDetail( String contactDetailValue,
String detailDisplayName,
Category category)
{
this(contactDetailValue, detailDisplayName, category, null);
}
/**
@ -360,10 +396,35 @@ public ContactDetail( String contactDetailValue,
public ContactDetail( String contactDetailValue,
Category category,
SubCategory[] subCategories)
{
this(contactDetailValue, null, category, subCategories);
}
/**
* Initializes a new <tt>ContactDetail</tt> instance which is to represent a
* specific contact address and which is to be optionally labeled with a
* specific set of labels.
*
* @param contactDetailValue the contact detail value to be represented by
* the new <tt>ContactDetail</tt> instance
* @param detailDisplayName the display name of this detail
* @param category
* @param subCategories the set of sub categories with which the new
* <tt>ContactDetail</tt> instance is to be labeled.
*/
public ContactDetail( String contactDetailValue,
String detailDisplayName,
Category category,
SubCategory[] subCategories)
{
// the value of the detail
this.contactDetailValue = contactDetailValue;
if (!StringUtils.isNullOrEmpty(detailDisplayName))
this.detailDisplayName = detailDisplayName;
else
this.detailDisplayName = contactDetailValue;
// category & labels
this.category = category;
@ -464,6 +525,17 @@ public String getDetail()
return contactDetailValue;
}
/**
* Returns the display name of this detail. By default returns the detail
* value.
*
* @return the display name of this detail
*/
public String getDisplayName()
{
return detailDisplayName;
}
/**
* Returns the preferred <tt>ProtocolProviderService</tt> when using the
* given <tt>opSetClass</tt>.

@ -5,5 +5,6 @@ Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.util,
net.java.sip.communicator.service.protocol
net.java.sip.communicator.service.protocol,
org.jitsi.util
Export-Package: net.java.sip.communicator.service.contactsource

Loading…
Cancel
Save