投稿に関しては論理削除するように
処理をシンプルにするため
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user