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);
}
Aggregations