koishi-plugin-best-cave 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +4 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -506,7 +506,8 @@ async function handleFileUploads(ctx, config, fileManager, logger2, reviewManage
506
506
  }
507
507
  }
508
508
  await Promise.all(downloadedMedia.map((item) => fileManager.saveFile(item.fileName, item.buffer)));
509
- const finalStatus = config.enablePend ? "pending" : "active";
509
+ const needsReview = config.enablePend && session.channelId !== config.adminChannel?.split(":")[1];
510
+ const finalStatus = needsReview ? "pending" : "active";
510
511
  await ctx.database.upsert("cave", [{ id: cave.id, status: finalStatus }]);
511
512
  if (hashManager) {
512
513
  const allHashesToInsert = [...textHashesToStore, ...imageHashesToStore].map((h4) => ({ ...h4, cave: cave.id }));
@@ -1074,7 +1075,8 @@ function apply(ctx, config) {
1074
1075
  }
1075
1076
  const userName = (config.enableName ? await profileManager.getNickname(session.userId) : null) || session.username;
1076
1077
  const hasMedia = mediaToSave.length > 0;
1077
- const initialStatus = hasMedia ? "preload" : config.enablePend ? "pending" : "active";
1078
+ const needsReview = config.enablePend && session.channelId !== config.adminChannel?.split(":")[1];
1079
+ const initialStatus = hasMedia ? "preload" : needsReview ? "pending" : "active";
1078
1080
  const newCave = await ctx.database.create("cave", {
1079
1081
  id: newId,
1080
1082
  elements: finalElementsForDb,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-best-cave",
3
3
  "description": "功能强大、高度可定制的回声洞。支持丰富的媒体类型、内容查重、人工审核、用户昵称、数据迁移以及本地/S3 双重文件存储后端。",
4
- "version": "2.4.1",
4
+ "version": "2.4.2",
5
5
  "contributors": [
6
6
  "Yis_Rime <yis_rime@outlook.com>"
7
7
  ],