Search in sources :

Example 1 with RequestTyping

use of im.actor.core.api.rpc.RequestTyping in project actor-platform by actorapp.

the class OwnTypingActor method onTyping.

@Verified
private void onTyping(Peer peer) {
    if (ActorTime.currentTime() - lastTypingTime < TYPING_DELAY) {
        return;
    }
    lastTypingTime = ActorTime.currentTime();
    ApiOutPeer outPeer = buidOutPeer(peer);
    if (outPeer == null) {
        return;
    }
    cancelPrevRequest();
    prevRid = request(new RequestTyping(outPeer, ApiTypingType.TEXT));
    if (typingCancellable != null) {
        typingCancellable.cancel();
        typingCancellable = null;
    }
    typingCancellable = schedule(new AbortTyping(peer), TYPING_CANCEL_DELAY);
}
Also used : RequestTyping(im.actor.core.api.rpc.RequestTyping) ApiOutPeer(im.actor.core.api.ApiOutPeer) Verified(im.actor.runtime.annotations.Verified)

Aggregations

ApiOutPeer (im.actor.core.api.ApiOutPeer)1 RequestTyping (im.actor.core.api.rpc.RequestTyping)1 Verified (im.actor.runtime.annotations.Verified)1