Search in sources :

Example 1 with SetExtraInfoCmd

use of net.kano.joscar.snaccmd.conn.SetExtraInfoCmd in project Openfire by igniterealtime.

the class OSCARSession method updateStatus.

/**
     * @see net.sf.kraken.session.TransportSession#updateStatus(net.sf.kraken.type.PresenceType, String)
     */
@Override
public void updateStatus(PresenceType presenceType, String verboseStatus) {
    if (getTransport().getType().equals(TransportType.icq)) {
        request(new SetExtraInfoCmd(((OSCARTransport) getTransport()).convertXMPPStatusToICQ(presenceType)));
    }
    if (presenceType != PresenceType.available && presenceType != PresenceType.chat) {
        String awayMsg = LocaleUtils.getLocalizedString("gateway.oscar.away", "kraken");
        if (verboseStatus != null && verboseStatus.length() > 0) {
            awayMsg = verboseStatus;
        }
        request(new SetInfoCmd(InfoData.forAwayMessage(awayMsg)));
        if (!getTransport().getType().equals(TransportType.icq)) {
            presenceType = PresenceType.away;
        }
    } else {
        request(new SetInfoCmd(InfoData.forAwayMessage(InfoData.NOT_AWAY)));
        request(new SetExtraInfoCmd(new ExtraInfoBlock(ExtraInfoBlock.TYPE_AVAILMSG, ExtraInfoData.getAvailableMessageBlock(verboseStatus == null ? "" : verboseStatus))));
    }
    setPresenceAndStatus(presenceType, verboseStatus);
}
Also used : ExtraInfoBlock(net.kano.joscar.snaccmd.ExtraInfoBlock) SetExtraInfoCmd(net.kano.joscar.snaccmd.conn.SetExtraInfoCmd) SetInfoCmd(net.kano.joscar.snaccmd.loc.SetInfoCmd)

Aggregations

ExtraInfoBlock (net.kano.joscar.snaccmd.ExtraInfoBlock)1 SetExtraInfoCmd (net.kano.joscar.snaccmd.conn.SetExtraInfoCmd)1 SetInfoCmd (net.kano.joscar.snaccmd.loc.SetInfoCmd)1