feat: add realtime announcements for permission changes and note deletion

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2022-09-04 23:38:26 +02:00
parent c363d0834e
commit 331747f61b
6 changed files with 56 additions and 3 deletions

View file

@ -260,6 +260,10 @@ export class NotesService {
* @throws {NotInDBError} there is no note with this id or alias
*/
async deleteNote(note: Note): Promise<Note> {
const realtimeNote = this.realtimeNoteStore.find(note.id);
if (realtimeNote) {
realtimeNote.announceNoteDeletion();
}
return await this.noteRepository.remove(note);
}