Search in sources :

Example 1 with RouterConversationVisible

use of im.actor.core.modules.messaging.router.entity.RouterConversationVisible in project actor-platform by actorapp.

the class RouterInt method onBusEvent.

@Override
public void onBusEvent(Event event) {
    if (event instanceof PeerChatOpened) {
        PeerChatOpened peerChatOpened = (PeerChatOpened) event;
        send(new RouterConversationVisible(peerChatOpened.getPeer()));
    } else if (event instanceof PeerChatClosed) {
        PeerChatClosed peerChatClosed = (PeerChatClosed) event;
        send(new RouterConversationHidden(peerChatClosed.getPeer()));
    } else if (event instanceof AppVisibleChanged) {
        if (((AppVisibleChanged) event).isVisible()) {
            send(new RouterAppVisible());
        } else {
            send(new RouterAppHidden());
        }
    }
}
Also used : RouterAppVisible(im.actor.core.modules.messaging.router.entity.RouterAppVisible) RouterAppHidden(im.actor.core.modules.messaging.router.entity.RouterAppHidden) PeerChatOpened(im.actor.core.events.PeerChatOpened) AppVisibleChanged(im.actor.core.events.AppVisibleChanged) PeerChatClosed(im.actor.core.events.PeerChatClosed) RouterConversationVisible(im.actor.core.modules.messaging.router.entity.RouterConversationVisible) RouterConversationHidden(im.actor.core.modules.messaging.router.entity.RouterConversationHidden)

Example 2 with RouterConversationVisible

use of im.actor.core.modules.messaging.router.entity.RouterConversationVisible in project actor-platform by actorapp.

the class RouterActor method onReceive.

@Override
public void onReceive(Object message) {
    if (!activeDialogStorage.isLoaded() && message instanceof RouterMessageOnlyActive) {
        stash();
        return;
    }
    if (message instanceof RouterConversationVisible) {
        RouterConversationVisible conversationVisible = (RouterConversationVisible) message;
        onConversationVisible(conversationVisible.getPeer());
    } else if (message instanceof RouterConversationHidden) {
        RouterConversationHidden conversationHidden = (RouterConversationHidden) message;
        onConversationHidden(conversationHidden.getPeer());
    } else if (message instanceof RouterAppVisible) {
        onAppVisible();
    } else if (message instanceof RouterAppHidden) {
        onAppHidden();
    } else {
        super.onReceive(message);
    }
}
Also used : RouterAppVisible(im.actor.core.modules.messaging.router.entity.RouterAppVisible) RouterAppHidden(im.actor.core.modules.messaging.router.entity.RouterAppHidden) RouterMessageOnlyActive(im.actor.core.modules.messaging.router.entity.RouterMessageOnlyActive) RouterConversationVisible(im.actor.core.modules.messaging.router.entity.RouterConversationVisible) RouterConversationHidden(im.actor.core.modules.messaging.router.entity.RouterConversationHidden)

Aggregations

RouterAppHidden (im.actor.core.modules.messaging.router.entity.RouterAppHidden)2 RouterAppVisible (im.actor.core.modules.messaging.router.entity.RouterAppVisible)2 RouterConversationHidden (im.actor.core.modules.messaging.router.entity.RouterConversationHidden)2 RouterConversationVisible (im.actor.core.modules.messaging.router.entity.RouterConversationVisible)2 AppVisibleChanged (im.actor.core.events.AppVisibleChanged)1 PeerChatClosed (im.actor.core.events.PeerChatClosed)1 PeerChatOpened (im.actor.core.events.PeerChatOpened)1 RouterMessageOnlyActive (im.actor.core.modules.messaging.router.entity.RouterMessageOnlyActive)1