diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-06-04 22:07:39 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-04 22:07:39 +0900 |
| commit | 66de51c1ca2535b6c4de47e405e922690a1a9160 (patch) | |
| tree | e6168bfd2976a75aa1d0776629abdcb506330954 /src/server/api | |
| parent | ローカルのみボタンを公開範囲ピッカーに統合 (#6428) (diff) | |
| parent | missing ; (diff) | |
| download | sharkey-66de51c1ca2535b6c4de47e405e922690a1a9160.tar.gz sharkey-66de51c1ca2535b6c4de47e405e922690a1a9160.tar.bz2 sharkey-66de51c1ca2535b6c4de47e405e922690a1a9160.zip | |
feat: Observe notification read and fix #6406 (#6407)
* Resolve https://github.com/syuilo/misskey/pull/6406#issuecomment-633203670
* Improve typing
* Observe notification read
* capture readAllNotifications
* fix
* fix
* Refactor
* Update src/client/components/notification.vue
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* Update src/client/components/notification.vue
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
* missing ;
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/server/api')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 5 | ||||
| -rw-r--r-- | src/server/api/endpoints/notes/create.ts | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index 9a2e17a717..db6772beb3 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -4,6 +4,7 @@ import { readNotification } from '../../common/read-notification'; import define from '../../define'; import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notifications, Followings, Mutings, Users } from '../../../../models'; +import { notificationTypes } from '../../../../types'; export const meta = { desc: { @@ -42,12 +43,12 @@ export const meta = { }, includeTypes: { - validator: $.optional.arr($.str.or(['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted'])), + validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])), default: [] as string[] }, excludeTypes: { - validator: $.optional.arr($.str.or(['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted'])), + validator: $.optional.arr($.str.or(notificationTypes as unknown as string[])), default: [] as string[] } }, diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts index cccf138add..5076dad82a 100644 --- a/src/server/api/endpoints/notes/create.ts +++ b/src/server/api/endpoints/notes/create.ts @@ -11,6 +11,7 @@ import { Users, DriveFiles, Notes } from '../../../../models'; import { DriveFile } from '../../../../models/entities/drive-file'; import { Note } from '../../../../models/entities/note'; import { DB_MAX_NOTE_TEXT_LENGTH } from '../../../../misc/hard-limits'; +import { noteVisibilities } from '../../../../types'; let maxNoteTextLength = 500; @@ -38,7 +39,7 @@ export const meta = { params: { visibility: { - validator: $.optional.str.or(['public', 'home', 'followers', 'specified']), + validator: $.optional.str.or(noteVisibilities as unknown as string[]), default: 'public', desc: { 'ja-JP': '投稿の公開範囲' |