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:
commit
53365159e8
7 changed files with 91 additions and 10 deletions
|
@ -130,6 +130,9 @@ export interface NoteEventTypes {
|
|||
reaction: string;
|
||||
userId: MiUser['id'];
|
||||
};
|
||||
replied: {
|
||||
id: MiNote['id'];
|
||||
};
|
||||
}
|
||||
type NoteStreamEventTypes = {
|
||||
[key in keyof NoteEventTypes]: {
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue