src/net/java/sip/communicator/impl/protocol/jabber/OperationSetPersistentPresenceJabberImpl.java
/**
     * Converts the specified jabber status to one of the status fields of the
     * JabberStatusEnum class.
     *
     * @param presence the Jabber Status
     * @param jabberProvider the parent provider.
     * @return a PresenceStatus instance representation of the Jabber Status
     * parameter. The returned result is one of the JabberStatusEnum fields.
     */
Converts the specified jabber status to one of the status fields of the
JabberStatusEnum class.

@param presence the Jabber Status
@param jabberProvider the parent provider.
@return a PresenceStatus instance representation of the Jabber Status
parameter. The returned result is one of the JabberStatusEnum fields.
Converts the specified jabber status to one of the status fields of the JabberStatusEnum class . @param presence the Jabber Status @param jabberProvider the parent provider . @return a PresenceStatus instance representation of the Jabber Status parameter . The returned result is one of the JabberStatusEnum fields .
public static PresenceStatus jabberStatusToPresenceStatus(
        Presence presence, ProtocolProviderServiceJabberImpl jabberProvider)
    {
        JabberStatusEnum jabberStatusEnum = jabberProvider.getJabberStatusEnum();
        if(!presence.isAvailable())
            return jabberStatusEnum.getStatus(JabberStatusEnum.OFFLINE);
        Presence.Mode mode = presence.getMode();
        if(mode.equals(Presence.Mode.available))
            return jabberStatusEnum.getStatus(JabberStatusEnum.AVAILABLE);
        else if(mode.equals(Presence.Mode.away))
        {
            if(presence.getStatus() != null
                && presence.getStatus().contains(JabberStatusEnum.ON_THE_PHONE))
                return jabberStatusEnum.getStatus(JabberStatusEnum.ON_THE_PHONE);
            else if(presence.getStatus() != null
                && presence.getStatus().contains(JabberStatusEnum.IN_A_MEETING))
                return jabberStatusEnum.getStatus(JabberStatusEnum.IN_A_MEETING);
            else
                return jabberStatusEnum.getStatus(JabberStatusEnum.AWAY);
        }
        else if(mode.equals(Presence.Mode.chat))
            return jabberStatusEnum.getStatus(JabberStatusEnum.FREE_FOR_CHAT);
        else if(mode.equals(Presence.Mode.dnd))
            return jabberStatusEnum.getStatus(JabberStatusEnum.DO_NOT_DISTURB);
        else if(mode.equals(Presence.Mode.xa))
            return jabberStatusEnum.getStatus(JabberStatusEnum.EXTENDED_AWAY);
        else
        {
            if(presence.isAway())
                return jabberStatusEnum.getStatus(JabberStatusEnum.AWAY);
            if(presence.isAvailable())
                return jabberStatusEnum.getStatus(JabberStatusEnum.AVAILABLE);
            return jabberStatusEnum.getStatus(JabberStatusEnum.OFFLINE);
        }
    }
public static PresenceStatus jabberStatusToPresenceStatus ( Presence presence , ProtocolProviderServiceJabberImpl jabberProvider ) { JabberStatusEnum jabberStatusEnum = jabberProvider . getJabberStatusEnum ( ) ; if ( ! presence . isAvailable ( ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . OFFLINE ) ; Presence . Mode mode = presence . getMode ( ) ; if ( mode . equals ( Presence . Mode . available ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . AVAILABLE ) ; else if ( mode . equals ( Presence . Mode . away ) ) { if ( presence . getStatus ( ) != null && presence . getStatus ( ) . contains ( JabberStatusEnum . ON_THE_PHONE ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . ON_THE_PHONE ) ; else if ( presence . getStatus ( ) != null && presence . getStatus ( ) . contains ( JabberStatusEnum . IN_A_MEETING ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . IN_A_MEETING ) ; else return jabberStatusEnum . getStatus ( JabberStatusEnum . AWAY ) ; } else if ( mode . equals ( Presence . Mode . chat ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . FREE_FOR_CHAT ) ; else if ( mode . equals ( Presence . Mode . dnd ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . DO_NOT_DISTURB ) ; else if ( mode . equals ( Presence . Mode . xa ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . EXTENDED_AWAY ) ; else { if ( presence . isAway ( ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . AWAY ) ; if ( presence . isAvailable ( ) ) return jabberStatusEnum . getStatus ( JabberStatusEnum . AVAILABLE ) ; return jabberStatusEnum . getStatus ( JabberStatusEnum . OFFLINE ) ; } }
Converts the specified jabber status to one of the status fields of the
 JabberStatusEnum class.
Converts the specified jabber status to one of the status fields of the JabberStatusEnum class .
// on the phone a special status // which is away with custom status message //unknown status