diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-21 17:38:09 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-03-21 17:38:09 +0900 |
| commit | 667d58bad4544d6e9dc75cfc4e6216179e2bc1aa (patch) | |
| tree | d6ac2da158cece66b1815c9bab754e333628c7c8 /src/server/api/stream/channels/main.ts | |
| parent | Revert "perf: Reduce database query" (diff) | |
| download | sharkey-667d58bad4544d6e9dc75cfc4e6216179e2bc1aa.tar.gz sharkey-667d58bad4544d6e9dc75cfc4e6216179e2bc1aa.tar.bz2 sharkey-667d58bad4544d6e9dc75cfc4e6216179e2bc1aa.zip | |
better note read handling
Diffstat (limited to 'src/server/api/stream/channels/main.ts')
| -rw-r--r-- | src/server/api/stream/channels/main.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/api/stream/channels/main.ts b/src/server/api/stream/channels/main.ts index b69c2ec355..780bc0b89f 100644 --- a/src/server/api/stream/channels/main.ts +++ b/src/server/api/stream/channels/main.ts @@ -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; } |