|
|
|
|
@ -110,15 +110,20 @@ public ProtocolProviderService getProtocolProviderService()
|
|
|
|
|
{
|
|
|
|
|
update(source);
|
|
|
|
|
|
|
|
|
|
if(source instanceof MessageDeliveredEvent
|
|
|
|
|
|| source instanceof MessageReceivedEvent)
|
|
|
|
|
if(source instanceof MessageDeliveredEvent)
|
|
|
|
|
{
|
|
|
|
|
initDetails(false,
|
|
|
|
|
((MessageDeliveredEvent)source).getDestinationContact());
|
|
|
|
|
}
|
|
|
|
|
else if(source instanceof MessageReceivedEvent)
|
|
|
|
|
{
|
|
|
|
|
initDetails(false);
|
|
|
|
|
initDetails(false,
|
|
|
|
|
((MessageReceivedEvent)source).getSourceContact());
|
|
|
|
|
}
|
|
|
|
|
else if(source instanceof ChatRoomMessageDeliveredEvent
|
|
|
|
|
|| source instanceof ChatRoomMessageReceivedEvent)
|
|
|
|
|
{
|
|
|
|
|
initDetails(true);
|
|
|
|
|
initDetails(true, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.service = service;
|
|
|
|
|
@ -277,7 +282,7 @@ public String toString()
|
|
|
|
|
* Will skip OperationSetBasicInstantMessaging for chat rooms.
|
|
|
|
|
* @param isChatRoom is current source contact a chat room.
|
|
|
|
|
*/
|
|
|
|
|
private void initDetails(boolean isChatRoom)
|
|
|
|
|
private void initDetails(boolean isChatRoom, Contact contact)
|
|
|
|
|
{
|
|
|
|
|
ContactDetail contactDetail =
|
|
|
|
|
new ContactDetail(
|
|
|
|
|
@ -290,6 +295,13 @@ private void initDetails(boolean isChatRoom)
|
|
|
|
|
ProtocolProviderService preferredProvider
|
|
|
|
|
= this.ppService;
|
|
|
|
|
|
|
|
|
|
OperationSetContactCapabilities capOpSet
|
|
|
|
|
= preferredProvider
|
|
|
|
|
.getOperationSet(OperationSetContactCapabilities.class);
|
|
|
|
|
Map<String, OperationSet> opsetCapabilities = null;
|
|
|
|
|
if(capOpSet != null)
|
|
|
|
|
opsetCapabilities = capOpSet.getSupportedOperationSets(contact);
|
|
|
|
|
|
|
|
|
|
if (preferredProvider != null)
|
|
|
|
|
{
|
|
|
|
|
preferredProviders
|
|
|
|
|
@ -312,6 +324,11 @@ private void initDetails(boolean isChatRoom)
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!isChatRoom
|
|
|
|
|
&& opsetCapabilities != null
|
|
|
|
|
&& !opsetCapabilities.containsKey(opset.getName()))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
preferredProviders.put(opset, preferredProvider);
|
|
|
|
|
|
|
|
|
|
supportedOpSets.add(opset);
|
|
|
|
|
|