summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/i
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-07-27 13:34:20 +0900
committerGitHub <noreply@github.com>2020-07-27 13:34:20 +0900
commitcf43dd6ec530ba4a3f589ae917e89533b352f6a3 (patch)
tree76f35d06299b40370ec061ee5ed58182847d2e6e /src/server/api/endpoints/i
parentrefactor(client): Do not mutate prop directly (diff)
downloadsharkey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.gz
sharkey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.bz2
sharkey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.zip
ワードミュート (#6594)
* wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'src/server/api/endpoints/i')
-rw-r--r--src/server/api/endpoints/i/update.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index 48b5e48fc2..e1889df22d 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -142,7 +142,11 @@ export const meta = {
desc: {
'ja-JP': 'ピン留めするページID'
}
- }
+ },
+
+ mutedWords: {
+ validator: $.optional.arr($.arr($.str))
+ },
},
errors: {
@@ -193,6 +197,10 @@ export default define(meta, async (ps, user, token) => {
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
if (ps.avatarId !== undefined) updates.avatarId = ps.avatarId;
if (ps.bannerId !== undefined) updates.bannerId = ps.bannerId;
+ if (ps.mutedWords !== undefined) {
+ profileUpdates.mutedWords = ps.mutedWords;
+ profileUpdates.enableWordMute = ps.mutedWords.length > 0;
+ }
if (typeof ps.isLocked === 'boolean') updates.isLocked = ps.isLocked;
if (typeof ps.isBot === 'boolean') updates.isBot = ps.isBot;
if (typeof ps.carefulBot === 'boolean') profileUpdates.carefulBot = ps.carefulBot;