fix(cdn-caching): 自分のリアクションが表示されない問題を修正 (MisskeyIO#851)

This commit is contained in:
あわわわとーにゅ 2024-12-25 14:13:45 +09:00 committed by GitHub
parent 5073467f1d
commit 8b17ab77b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 103 additions and 71 deletions

View file

@ -19,7 +19,7 @@ class LocalTimelineChannel extends Channel {
private withRenotes: boolean;
private withReplies: boolean;
private withFiles: boolean;
private idOnly: boolean;
private minimize: boolean;
constructor(
private metaService: MetaService,
@ -41,7 +41,7 @@ class LocalTimelineChannel extends Channel {
this.withRenotes = params.withRenotes ?? true;
this.withReplies = params.withReplies ?? false;
this.withFiles = params.withFiles ?? false;
this.idOnly = params.idOnly ?? false;
this.minimize = params.minimize ?? false;
// Subscribe events
this.subscriber.on('notesStream', this.onNote);
@ -90,9 +90,13 @@ class LocalTimelineChannel extends Channel {
}
}
if (this.idOnly && ['public', 'home'].includes(note.visibility)) {
const idOnlyNote = { id: note.id };
this.send('note', idOnlyNote);
if (this.minimize && ['public', 'home'].includes(note.visibility)) {
this.send('note', {
id: note.id, myReaction: note.myReaction,
poll: note.poll ? { choices: note.poll.choices } : undefined,
reply: note.reply ? { myReaction: note.reply.myReaction } : undefined,
renote: note.renote ? { myReaction: note.renote.myReaction } : undefined,
});
} else {
this.connection.cacheNote(note);
this.send('note', note);