code: @Override
      public void onReceive(Object message) {
          if (message instanceof Typing) {
              onTyping(((Typing) message).getPeer());
          } else if (message instanceof MessageSent) {
              onMessageSent(((MessageSent) message).getPeer());
          } else if (message instanceof AbortTyping) {
              onAbortTyping(((AbortTyping) message).getPeer());
          } else {
              super.onReceive(message);
          }
      }
docs: Messages