chatType isn't the same as eventType (which is checked by the outer loop). For messaging, the chatType will be P2P for one-to-one chats or one of two other choices for group chats. It's basically unused in the current implementation.