summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-14 20:11:01 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-14 20:11:01 +0900
commit3220d69a6930151f33928b5d789150aacc4bc382 (patch)
tree3687ed4e67dfd5f6585867dae21b306b7cc6cfd5 /src/server/api/endpoints
parent8.38.0 (diff)
downloadsharkey-3220d69a6930151f33928b5d789150aacc4bc382.tar.gz
sharkey-3220d69a6930151f33928b5d789150aacc4bc382.tar.bz2
sharkey-3220d69a6930151f33928b5d789150aacc4bc382.zip
常にメディアを閲覧注意として投稿するオプションを実装
Diffstat (limited to 'src/server/api/endpoints')
-rw-r--r--src/server/api/endpoints/drive/files/create.ts4
-rw-r--r--src/server/api/endpoints/i/update.ts7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/server/api/endpoints/drive/files/create.ts b/src/server/api/endpoints/drive/files/create.ts
index dfbd11d0c2..4b5ffa90e0 100644
--- a/src/server/api/endpoints/drive/files/create.ts
+++ b/src/server/api/endpoints/drive/files/create.ts
@@ -31,8 +31,8 @@ export const meta = {
}
}),
- isSensitive: $.bool.optional.note({
- default: false,
+ isSensitive: $.bool.optional.nullable.note({
+ default: null,
desc: {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index 6aa4cc1148..c1be0b6ebc 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -84,6 +84,12 @@ export const meta = {
'ja-JP': '投稿の自動ウォッチをするか否か'
}
}),
+
+ alwaysMarkNsfw: $.bool.optional.note({
+ desc: {
+ 'ja-JP': 'アップロードするメディアをデフォルトで「閲覧注意」として設定するか'
+ }
+ }),
}
};
@@ -106,6 +112,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
if (typeof ps.isBot == 'boolean') updates.isBot = ps.isBot;
if (typeof ps.isCat == 'boolean') updates.isCat = ps.isCat;
if (typeof ps.autoWatch == 'boolean') updates['settings.autoWatch'] = ps.autoWatch;
+ if (typeof ps.alwaysMarkNsfw == 'boolean') updates['settings.alwaysMarkNsfw'] = ps.alwaysMarkNsfw;
if (ps.avatarId) {
const avatar = await DriveFile.findOne({