Skip to content

Commit

Permalink
アカウント削除時に受信したNotificationを削除するように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Oct 28, 2021
1 parent 84efe94 commit 218b366
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/services/suspend-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ import Following from '../models/following';
import deleteFollowing from '../services/following/delete';
import rejectFollowing from '../services/following/requests/reject';
import FollowRequest from '../models/follow-request';
import Notification from '../models/notification';

export async function doPostSuspend(user: IUser) {
await unFollowAll(user).catch(() => {});
await rejectFollowAll(user).catch(() => {});
await removeFollowingRequestAll(user).catch(() => {});
await removeFollowedRequestAll(user).catch(() => {});
await sendDeleteActivity(user).catch(() => {});

// アカウント削除時に受信したNotificationを削除するように
await Notification.remove({
notifieeId: user._id
}).catch(() => {});
}



export async function sendDeleteActivity(user: IUser) {
if (isLocalUser(user)) {
// 知り得る全SharedInboxにDelete配信
Expand Down

0 comments on commit 218b366

Please sign in to comment.