@Override
 public BoardModel getBoard(String shortName, ProgressListener listener, CancellableTask task)
     throws Exception {
   Map<String, SimpleBoardModel> map = getBoardsMap(listener, task);
   SimpleBoardModel simpleModel = map.get(shortName);
   BoardModel model = new BoardModel();
   model.chan = getChanName();
   model.boardName = shortName;
   model.boardDescription = shortName;
   model.uniqueAttachmentNames = true;
   model.timeZoneId = "UTC";
   model.defaultUserName = "******";
   model.bumpLimit = 500;
   model.readonlyBoard = true;
   model.firstPage = 0;
   model.lastPage = BoardModel.LAST_PAGE_UNDEFINED;
   model.searchAllowed = false;
   model.catalogAllowed = false;
   if (simpleModel != null) {
     model.boardDescription = simpleModel.boardDescription;
     model.boardCategory = simpleModel.boardCategory;
     model.nsfw = simpleModel.nsfw;
   }
   return model;
 }
Ejemplo n.º 2
0
  private static BoardModel createDefaultBoardModel(
      String name, String description, String category, String defaultPosterName, boolean nsfw) {
    BoardModel model = new BoardModel();
    model.chan = CirnoModule.IICHAN_NAME;
    model.boardName = name;
    model.boardDescription = description;
    model.boardCategory = category;
    model.nsfw = nsfw;
    model.uniqueAttachmentNames = true;
    model.timeZoneId = "GMT+3";
    model.defaultUserName = defaultPosterName;
    model.bumpLimit = 500;

    model.readonlyBoard =
        name.equals("o") || name.equals("w") || name.equals("abe") || name.equals("ma");
    model.requiredFileForNewThread = !name.equals("d");
    model.allowDeletePosts = true;
    model.allowDeleteFiles = true;
    model.allowReport = BoardModel.REPORT_WITH_COMMENT;
    model.allowNames = !name.equals("b") && !name.equals("bro");
    model.allowSubjects = true;
    model.allowSage = false;
    model.allowEmails = true;
    model.ignoreEmailIfSage = false;
    model.allowCustomMark = IICHAN_SPOILER_MARK_BOARDS.indexOf(name) != -1;
    model.customMarkDescription = "Spoiler";
    model.allowRandomHash = true;
    model.allowIcons = false;
    model.attachmentsMaxCount = name.equals("d") ? 0 : 1;
    model.attachmentsFormatFilters = ATTACHMENT_FILTERS;
    model.markType = BoardModel.MARK_WAKABAMARK;

    model.firstPage = 0;
    model.lastPage = BoardModel.LAST_PAGE_UNDEFINED;

    model.catalogAllowed = !name.equals("d");
    return model;
  }