Merge upstream

This commit is contained in:
ASTRO:? 2024-12-22 12:44:09 +09:00
commit 29c25555b8
No known key found for this signature in database
GPG key ID: 8947F3AF5B0B4BFE
40 changed files with 1183 additions and 667 deletions

View file

@ -19,6 +19,7 @@ class LocalTimelineChannel extends Channel {
private withRenotes: boolean;
private withReplies: boolean;
private withFiles: boolean;
private idOnly: boolean;
constructor(
private metaService: MetaService,
@ -40,6 +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;
// Subscribe events
this.subscriber.on('notesStream', this.onNote);
@ -93,9 +95,13 @@ class LocalTimelineChannel extends Channel {
}
}
this.connection.cacheNote(note);
this.send('note', note);
if (this.idOnly && ['public', 'home'].includes(note.visibility)) {
const idOnlyNote = { id: note.id };
this.send('note', idOnlyNote);
} else {
this.connection.cacheNote(note);
this.send('note', note);
}
}
@bindThis