code: protected int getType (ChatMessage message, boolean history)
      {
          String localtype = message.localtype;
  
          if (message instanceof TellFeedbackMessage) {
              if (((TellFeedbackMessage)message).isFailure()) {
                  return ChatLogic.FEEDBACK;
              }
              return (history || isApprovedLocalType(localtype)) ?
                  ChatLogic.TELLFEEDBACK : ChatLogic.IGNORECHAT;
  
          } else if (message instanceof UserMessage) {
              int type = _logic.decodeType(localtype);
              if (type != 0) {
                  // factor in the mode
                  return _logic.adjustTypeByMode(((UserMessage) message).mode, type);
              }
              // if we're showing from history, include specialized chat messages
              if (history) {
                  return ChatLogic.SPECIALIZED;
              }
              // otherwise fall through and IGNORECHAT
  
          } else if (message instanceof SystemMessage) {
              if (history || isApprovedLocalType(localtype)) {
                  switch (((SystemMessage) message).attentionLevel) {
                  case SystemMessage.INFO:
                      return ChatLogic.INFO;
                  case SystemMessage.FEEDBACK:
                      return ChatLogic.FEEDBACK;
                  case SystemMessage.ATTENTION:
                      return ChatLogic.ATTENTION;
                  default:
                      log.warning("Unknown attention level for system message", "msg", message);
                  }
              }
              return ChatLogic.IGNORECHAT;
          }
  
          log.warning("Skipping received message of unknown type", "msg", message);
          return ChatLogic.IGNORECHAT;
      }
docs: Convert the Message class/localtype/mode into our internal type code.