update latest_note for edits
This commit is contained in:
parent
93cf2f9045
commit
5dc700938d
1 changed files with 7 additions and 2 deletions
|
@ -52,6 +52,7 @@ import { isReply } from '@/misc/is-reply.js';
|
|||
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||
import { isUserRelated } from '@/misc/is-user-related.js';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||
import { LatestNoteService } from '@/core/LatestNoteService.js';
|
||||
|
||||
type NotificationType = 'reply' | 'renote' | 'quote' | 'mention' | 'edited';
|
||||
|
||||
|
@ -214,6 +215,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
private utilityService: UtilityService,
|
||||
private userBlockingService: UserBlockingService,
|
||||
private cacheService: CacheService,
|
||||
private latestNoteService: LatestNoteService,
|
||||
) { }
|
||||
|
||||
@bindThis
|
||||
|
@ -558,7 +560,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
setImmediate('post edited', { signal: this.#shutdownController.signal }).then(
|
||||
() => this.postNoteEdited(note, user, data, silent, tags!, mentionedUsers!),
|
||||
() => this.postNoteEdited(note, oldnote, user, data, silent, tags!, mentionedUsers!),
|
||||
() => { /* aborted, ignore this */ },
|
||||
);
|
||||
|
||||
|
@ -569,7 +571,7 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
private async postNoteEdited(note: MiNote, user: {
|
||||
private async postNoteEdited(note: MiNote, oldNote: MiNote, user: {
|
||||
id: MiUser['id'];
|
||||
username: MiUser['username'];
|
||||
host: MiUser['host'];
|
||||
|
@ -766,6 +768,9 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||
});
|
||||
}
|
||||
|
||||
// Update the Latest Note index / following feed
|
||||
this.latestNoteService.handleUpdatedNoteBG(oldNote, note);
|
||||
|
||||
// Register to search database
|
||||
if (!user.noindex) this.index(note);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue