summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteDeleteService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/NoteDeleteService.ts')
-rw-r--r--packages/backend/src/core/NoteDeleteService.ts36
1 files changed, 0 insertions, 36 deletions
diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts
index e394506a44..af1f0eda9a 100644
--- a/packages/backend/src/core/NoteDeleteService.ts
+++ b/packages/backend/src/core/NoteDeleteService.ts
@@ -62,7 +62,6 @@ export class NoteDeleteService {
*/
async delete(user: { id: MiUser['id']; uri: MiUser['uri']; host: MiUser['host']; isBot: MiUser['isBot']; }, note: MiNote, quiet = false, deleter?: MiUser) {
const deletedAt = new Date();
- const cascadingNotes = await this.findCascadingNotes(note);
if (note.replyId) {
await this.notesRepository.decrement({ id: note.replyId }, 'repliesCount', 1);
@@ -90,15 +89,6 @@ export class NoteDeleteService {
this.deliverToConcerned(user, note, content);
}
-
- // also deliver delete activity to cascaded notes
- const federatedLocalCascadingNotes = (cascadingNotes).filter(note => !note.localOnly && note.userHost == null); // filter out local-only notes
- for (const cascadingNote of federatedLocalCascadingNotes) {
- if (!cascadingNote.user) continue;
- if (!this.userEntityService.isLocalUser(cascadingNote.user)) continue;
- const content = this.apRendererService.addContext(this.apRendererService.renderDelete(this.apRendererService.renderTombstone(`${this.config.url}/notes/${cascadingNote.id}`), cascadingNote.user));
- this.deliverToConcerned(cascadingNote.user, cascadingNote, content);
- }
//#endregion
this.notesChart.update(note, false);
@@ -118,9 +108,6 @@ export class NoteDeleteService {
}
}
- for (const cascadingNote of cascadingNotes) {
- this.searchService.unindexNote(cascadingNote);
- }
this.searchService.unindexNote(note);
await this.notesRepository.delete({
@@ -141,29 +128,6 @@ export class NoteDeleteService {
}
@bindThis
- private async findCascadingNotes(note: MiNote): Promise<MiNote[]> {
- const recursive = async (noteId: string): Promise<MiNote[]> => {
- const query = this.notesRepository.createQueryBuilder('note')
- .where('note.replyId = :noteId', { noteId })
- .orWhere(new Brackets(q => {
- q.where('note.renoteId = :noteId', { noteId })
- .andWhere('note.text IS NOT NULL');
- }))
- .leftJoinAndSelect('note.user', 'user');
- const replies = await query.getMany();
-
- return [
- replies,
- ...await Promise.all(replies.map(reply => recursive(reply.id))),
- ].flat();
- };
-
- const cascadingNotes: MiNote[] = await recursive(note.id);
-
- return cascadingNotes;
- }
-
- @bindThis
private async getMentionedRemoteUsers(note: MiNote) {
const where = [] as any[];