投稿に関しては論理削除するように

処理をシンプルにするため
This commit is contained in:
syuilo
2018-04-07 07:19:30 +09:00
parent 8273a7e748
commit 494597236c
5 changed files with 10 additions and 43 deletions

View File

@@ -1,7 +1,6 @@
import * as debug from 'debug';
import Post from '../../../../models/post';
import { createDb } from '../../../../queue';
import { IRemoteUser } from '../../../../models/user';
const log = debug('misskey:activitypub');
@@ -19,10 +18,13 @@ export default async function(actor: IRemoteUser, uri: string): Promise<void> {
throw new Error('投稿を削除しようとしているユーザーは投稿の作成者ではありません');
}
Post.remove({ _id: post._id });
createDb({
type: 'deletePostDependents',
id: post._id
}).delay(65536).save();
Post.update({ _id: post._id }, {
$set: {
deletedAt: new Date(),
text: null,
textHtml: null,
mediaIds: [],
poll: null
}
});
}