src/net/java/sip/communicator/impl/protocol/jabber/MobileIndicator.java
/**
     * Called when resources have been updated for a contact, on
     * presence changed.
     * @param contact the contact
     */
Called when resources have been updated for a contact, on
presence changed.
@param contact the contact
Called when resources have been updated for a contact on presence changed . @param contact the contact
public void resourcesUpdated(ContactJabberImpl contact)
    {
        if(isCapsMobileIndicator)
        {
            updateMobileIndicatorUsingCaps(contact.getAddressAsJid());
            return;
        }
        int highestPriority = Integer.MIN_VALUE;
        List<ContactResource> highestPriorityResources =
            new ArrayList<>();
        Collection<ContactResource> resources = contact.getResources();
        if(resources == null)
            return;
        for(ContactResource res : resources)
        {
            if(!res.getPresenceStatus().isOnline())
                continue;
            int prio = res.getPriority();
            if(prio >= highestPriority)
            {
                if(highestPriority != prio)
                    highestPriorityResources.clear();
                highestPriority = prio;
                highestPriorityResources.add(res);
            }
        }
        updateContactMobileStatus(contact, highestPriorityResources);
    }
public void resourcesUpdated ( ContactJabberImpl contact ) { if ( isCapsMobileIndicator ) { updateMobileIndicatorUsingCaps ( contact . getAddressAsJid ( ) ) ; return ; } int highestPriority = Integer . MIN_VALUE ; List < ContactResource > highestPriorityResources = new ArrayList < > ( ) ; Collection < ContactResource > resources = contact . getResources ( ) ; if ( resources == null ) return ; for ( ContactResource res : resources ) { if ( ! res . getPresenceStatus ( ) . isOnline ( ) ) continue ; int prio = res . getPriority ( ) ; if ( prio >= highestPriority ) { if ( highestPriority != prio ) highestPriorityResources . clear ( ) ; highestPriority = prio ; highestPriorityResources . add ( res ) ; } } updateContactMobileStatus ( contact , highestPriorityResources ) ; }
Called when resources have been updated for a contact, on
 presence changed.
Called when resources have been updated for a contact on presence changed .
// we update it also here, cause sometimes caps update comes // before presence changed and contacts are still offline // and we dispatch wrong initial mobile indicator // checks resource starts with String and is current highest priority // sometimes volatile contacts do not have resources