diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 06:34:55 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-15 06:34:55 +0900 |
| commit | 0ef280377bbbd357bef688ab5c7fd609fd78af72 (patch) | |
| tree | 7745b237a21de429e828c6f007a59812894fabbf /src/models/user.ts | |
| parent | i18n (diff) | |
| download | misskey-0ef280377bbbd357bef688ab5c7fd609fd78af72.tar.gz misskey-0ef280377bbbd357bef688ab5c7fd609fd78af72.tar.bz2 misskey-0ef280377bbbd357bef688ab5c7fd609fd78af72.zip | |
wip
Diffstat (limited to 'src/models/user.ts')
| -rw-r--r-- | src/models/user.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/models/user.ts b/src/models/user.ts index 686bcc5ec5..56ca0c625f 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -19,6 +19,7 @@ import PollVote, { deletePollVote } from './poll-vote'; import FollowingLog, { deleteFollowingLog } from './following-log'; import FollowedLog, { deleteFollowedLog } from './followed-log'; import SwSubscription, { deleteSwSubscription } from './sw-subscription'; +import Notification, { deleteNotification } from './notification'; const User = db.get<IUser>('users'); @@ -246,6 +247,16 @@ export async function deleteUser(user: string | mongo.ObjectID | IUser) { await SwSubscription.find({ userId: u._id }) ).map(x => deleteSwSubscription(x))); + // このユーザーのNotificationをすべて削除 + await Promise.all(( + await Notification.find({ notifieeId: u._id }) + ).map(x => deleteNotification(x))); + + // このユーザーが原因となったNotificationをすべて削除 + await Promise.all(( + await Notification.find({ notifierId: u._id }) + ).map(x => deleteNotification(x))); + // このユーザーを削除 } |