Fixes searching for cusax capable provider.

sipgateway 5292
Damian Minkov 11 years ago
parent e0887ceb8e
commit c0c8d8d1ab

@ -1462,14 +1462,22 @@ public static String getPeerDisplayName(CallPeer peer,
OperationSetCusaxUtils.class); OperationSetCusaxUtils.class);
if (cusaxProviders != null && cusaxProviders.size() > 0) if (cusaxProviders != null && cusaxProviders.size() > 0)
{
Iterator<ProtocolProviderService> iter
= cusaxProviders.iterator();
while(iter.hasNext())
{ {
Contact contact = getPeerContact( Contact contact = getPeerContact(
peer, peer,
cusaxProviders.iterator().next(), iter.next(),
imppAddress); imppAddress);
displayName = (contact != null) displayName = (contact != null)
? contact.getDisplayName() : null; ? contact.getDisplayName() : null;
if(!StringUtils.isNullOrEmpty(displayName, true))
break;
}
} }
else else
{ {
@ -1560,13 +1568,22 @@ public static byte[] getPeerImage(CallPeer peer)
OperationSetCusaxUtils.class); OperationSetCusaxUtils.class);
if (cusaxProviders != null && cusaxProviders.size() > 0) if (cusaxProviders != null && cusaxProviders.size() > 0)
{
Iterator<ProtocolProviderService> iter
= cusaxProviders.iterator();
while(iter.hasNext())
{ {
Contact contact = getPeerContact( Contact contact = getPeerContact(
peer, peer,
cusaxProviders.iterator().next(), iter.next(),
imppAddress); imppAddress);
image = (contact != null) ? getContactImage(contact) : null; image = (contact != null) ?
getContactImage(contact) : null;
if(image != null)
break;
}
} }
else else
{ {
@ -1648,8 +1665,11 @@ else if(uiContact.getDescriptor() instanceof SourceContact)
if (cusaxProviders != null && cusaxProviders.size() > 0) if (cusaxProviders != null && cusaxProviders.size() > 0)
{ {
ProtocolProviderService cusaxProvider Iterator<ProtocolProviderService> iter
= cusaxProviders.iterator().next(); = cusaxProviders.iterator();
while(iter.hasNext())
{
ProtocolProviderService cusaxProvider = iter.next();
Contact contact = getPeerContact( Contact contact = getPeerContact(
peer, peer,
@ -1664,6 +1684,7 @@ else if(uiContact.getDescriptor() instanceof SourceContact)
} }
} }
} }
}
return null; return null;
} }
@ -1809,7 +1830,7 @@ private static byte[] getContactImage(Contact contact)
} }
/** /**
* Returns the image for the given <tt>alternativePeerAddress</tt> by * Returns the peer contact for the given <tt>alternativePeerAddress</tt> by
* checking the if the <tt>callPeer</tt> exists as a detail in the given * checking the if the <tt>callPeer</tt> exists as a detail in the given
* <tt>cusaxProvider</tt>. * <tt>cusaxProvider</tt>.
* *
@ -1902,14 +1923,22 @@ else if(uiContact.getDescriptor() instanceof SourceContact)
OperationSetCusaxUtils.class); OperationSetCusaxUtils.class);
if (cusaxProviders != null && cusaxProviders.size() > 0) if (cusaxProviders != null && cusaxProviders.size() > 0)
{
Iterator<ProtocolProviderService> iter
= cusaxProviders.iterator();
while(iter.hasNext())
{ {
Contact contact = getPeerContact( Contact contact = getPeerContact(
peer, peer,
cusaxProviders.iterator().next(), iter.next(),
imppAddress); imppAddress);
return GuiActivator.getContactListService() MetaContact res = GuiActivator.getContactListService()
.findMetaContactByContact(contact); .findMetaContactByContact(contact);
if(res != null)
return res;
}
} }
else else
{ {

Loading…
Cancel
Save