public SnacCommand genSnacCommand(SnacPacket packet) {
    if (packet.getFamily() != MailCheckCmd.FAMILY_MAILCHECK) return null;

    int command = packet.getCommand();

    if (command == MailCheckCmd.CMD_UPDATE) {
      return new MailUpdate(packet);
    } else {
      return null;
    }
  }
  public SnacCommand genSnacCommand(SnacPacket packet) {
    if (packet.getFamily() != LocCommand.FAMILY_LOC) return null;

    int command = packet.getCommand();

    if (command == LocCommand.CMD_RIGHTS_REQ) {
      return new LocRightsRequest(packet);
    } else if (command == LocCommand.CMD_SET_INFO) {
      return new SetInfoCmd(packet);
    } else if (command == LocCommand.CMD_OLD_GET_INFO) {
      return new OldGetInfoCmd(packet);
    } else if (command == LocCommand.CMD_GET_DIR) {
      return new GetDirInfoCmd(packet);
    } else if (command == LocCommand.CMD_SET_INTERESTS) {
      return new SetInterestsCmd(packet);
    } else if (command == LocCommand.CMD_SET_DIR) {
      return new SetDirInfoCmd(packet);
    } else if (command == LocCommand.CMD_NEW_GET_INFO) {
      return new GetInfoCmd(packet);
    } else {
      return null;
    }
  }