merge: real-time updates on note detail view (#246)

Closes #223

Reviewed-on: https://git.joinsharkey.org/Sharkey/Sharkey/pulls/246
Reviewed-by: Marie <marie@kaifa.ch>
This commit is contained in:
Marie 2023-12-23 21:00:00 +01:00
commit 53365159e8
7 changed files with 91 additions and 10 deletions

View file

@ -130,6 +130,9 @@ export interface NoteEventTypes {
reaction: string;
userId: MiUser['id'];
};
replied: {
id: MiNote['id'];
};
}
type NoteStreamEventTypes = {
[key in keyof NoteEventTypes]: {

View file

@ -780,6 +780,9 @@ export class NoteCreateService implements OnApplicationShutdown {
// If has in reply to note
if (data.reply) {
this.globalEventService.publishNoteStream(data.reply.id, 'replied', {
id: note.id,
});
// 通知
if (data.reply.userHost === null) {
const isThreadMuted = await this.noteThreadMutingsRepository.exist({