better note read handling

This commit is contained in:
syuilo 2021-03-21 17:38:09 +09:00
parent 630464f38d
commit 667d58bad4
15 changed files with 109 additions and 66 deletions

View file

@ -18,18 +18,22 @@ export default class extends Channel {
case 'notification': {
if (this.muting.has(body.userId)) return;
if (body.note && body.note.isHidden) {
body.note = await Notes.pack(body.note.id, this.user, {
const note = await Notes.pack(body.note.id, this.user, {
detail: true
});
this.connection.cacheNote(note);
body.note = note;
}
break;
}
case 'mention': {
if (this.muting.has(body.userId)) return;
if (body.isHidden) {
body = await Notes.pack(body.id, this.user, {
const note = await Notes.pack(body.id, this.user, {
detail: true
});
this.connection.cacheNote(note);
body = note;
}
break;
}