Search in sources :

Example 1 with RateInfoCmd

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

the class BasicFlapConnection method handleSnacResponse.

@Override
protected void handleSnacResponse(SnacResponseEvent e) {
    Log.debug("OSCAR snac packet response: " + e);
    SnacCommand cmd = e.getSnacCommand();
    if (cmd instanceof RateInfoCmd) {
        RateInfoCmd ric = (RateInfoCmd) cmd;
        List<RateClassInfo> rateClasses = ric.getRateClassInfos();
        int[] classes = new int[rateClasses.size()];
        for (int i = 0; i < rateClasses.size(); i++) {
            classes[i] = rateClasses.get(i).getRateClass();
        }
        request(new RateAck(classes));
    }
}
Also used : RateInfoCmd(net.kano.joscar.snaccmd.conn.RateInfoCmd) SnacCommand(net.kano.joscar.flapcmd.SnacCommand) RateClassInfo(net.kano.joscar.snaccmd.conn.RateClassInfo) RateAck(net.kano.joscar.snaccmd.conn.RateAck)

Example 2 with RateInfoCmd

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

the class ServiceConnection method handleSnacResponse.

@Override
protected void handleSnacResponse(SnacResponseEvent e) {
    super.handleSnacResponse(e);
    SnacCommand cmd = e.getSnacCommand();
    if (cmd instanceof RateInfoCmd) {
        // this is all we need.
        clientReady();
    }
}
Also used : RateInfoCmd(net.kano.joscar.snaccmd.conn.RateInfoCmd) SnacCommand(net.kano.joscar.flapcmd.SnacCommand)

Aggregations

SnacCommand (net.kano.joscar.flapcmd.SnacCommand)2 RateInfoCmd (net.kano.joscar.snaccmd.conn.RateInfoCmd)2 RateAck (net.kano.joscar.snaccmd.conn.RateAck)1 RateClassInfo (net.kano.joscar.snaccmd.conn.RateClassInfo)1