Search in sources :

Example 1 with RpcScope

use of im.actor.core.network.parser.RpcScope in project actor-platform by actorapp.

the class ApiBroker method processUpdate.

private void processUpdate(long authId, byte[] content) {
    if (authId != currentAuthId) {
        return;
    }
    ProtoStruct protoStruct;
    try {
        protoStruct = ProtoSerializer.readUpdate(content);
    } catch (IOException e) {
        e.printStackTrace();
        Log.w(TAG, "Broken mt update");
        return;
    }
    int type = ((Push) protoStruct).updateType;
    byte[] body = ((Push) protoStruct).body;
    RpcScope updateBox;
    try {
        updateBox = parserConfig.parseRpc(type, body);
    } catch (IOException e) {
        e.printStackTrace();
        Log.w(TAG, "Broken update box");
        return;
    }
    // Log.w(TAG, "Box: " + updateBox + "");
    callback.onUpdateReceived(updateBox);
}
Also used : ProtoStruct(im.actor.core.network.mtp.entity.ProtoStruct) RpcScope(im.actor.core.network.parser.RpcScope) IOException(java.io.IOException) Push(im.actor.core.network.mtp.entity.rpc.Push)

Aggregations

ProtoStruct (im.actor.core.network.mtp.entity.ProtoStruct)1 Push (im.actor.core.network.mtp.entity.rpc.Push)1 RpcScope (im.actor.core.network.parser.RpcScope)1 IOException (java.io.IOException)1