code: @Override
      public void onReceive(Object message) {
          if (message instanceof NewMessage) {
              NewMessage newMessage = (NewMessage) message;
              onNewMessage(newMessage.getPeer(), newMessage.getSender(), newMessage.getSortDate(),
                      newMessage.getContentDescription(), newMessage.getHasCurrentUserMention(),
                      newMessage.getUnreadMessagesCount(), newMessage.getUnreadDialogsCount());
          } else if (message instanceof MessagesRead) {
              MessagesRead read = (MessagesRead) message;
              onMessagesRead(read.getPeer(), read.getFromDate());
          } else if (message instanceof PauseNotifications) {
              onNotificationsPaused();
          } else if (message instanceof ResumeNotifications) {
              onNotificationsResumed();
          } else {
              super.onReceive(message);
          }
      }
docs: Receiving messages
  
  @param message message