diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-28 22:53:00 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-05-28 22:53:00 +0900 |
| commit | 0eb115bf7e4324e5aabbe64785c2e45bc00ceb2c (patch) | |
| tree | 5bc7090c1689fbbfd17e0a7c7716808180e1ce21 /src/server/api/endpoints/i | |
| parent | fix bug (diff) | |
| download | sharkey-0eb115bf7e4324e5aabbe64785c2e45bc00ceb2c.tar.gz sharkey-0eb115bf7e4324e5aabbe64785c2e45bc00ceb2c.tar.bz2 sharkey-0eb115bf7e4324e5aabbe64785c2e45bc00ceb2c.zip | |
Resolve #7538
Diffstat (limited to 'src/server/api/endpoints/i')
| -rw-r--r-- | src/server/api/endpoints/i/notifications.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index c597a28ebb..a10dc09df3 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -5,6 +5,7 @@ import define from '../../define'; import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notifications, Followings, Mutings, Users } from '../../../../models'; import { notificationTypes } from '../../../../types'; +import read from '@/services/note/read'; export const meta = { desc: { @@ -116,5 +117,11 @@ export default define(meta, async (ps, user) => { readNotification(user.id, notifications.map(x => x.id)); } + const notes = notifications.filter(notification => ['mention', 'reply', 'quote'].includes(notification.type)).map(notification => notification.note!); + + if (notes.length > 0) { + read(user.id, notes); + } + return await Notifications.packMany(notifications, user.id); }); |