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.
- package/lib/index.js +4 -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
|
|
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
|
|
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,
|