mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-04-28 09:36:56 +00:00
call NoteEntityService.hideNote from streaming API
This commit is contained in:
parent
30b2bfb184
commit
18f211e3bc
10 changed files with 22 additions and 1 deletions
|
@ -82,7 +82,19 @@ export default abstract class Channel {
|
|||
return false;
|
||||
}
|
||||
|
||||
constructor(id: string, connection: Connection) {
|
||||
protected async hideNote(note: Packed<'Note'>): Promise<void> {
|
||||
if (note.renote) {
|
||||
await this.hideNote(note.renote);
|
||||
}
|
||||
|
||||
if (note.reply) {
|
||||
await this.hideNote(note.reply);
|
||||
}
|
||||
|
||||
const meId = this.user?.id ?? null;
|
||||
await this.noteEntityService.hideNote(note, meId);
|
||||
}
|
||||
|
||||
constructor(id: string, connection: Connection, noteEntityService: NoteEntityService) {
|
||||
this.id = id;
|
||||
this.connection = connection;
|
||||
|
|
|
@ -64,6 +64,7 @@ class BubbleTimelineChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ class ChannelChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ class GlobalTimelineChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ class HashtagChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ class HomeTimelineChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ class HybridTimelineChannel extends Channel {
|
|||
}
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -71,6 +71,7 @@ class LocalTimelineChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ class RoleTimelineChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ class UserListChannel extends Channel {
|
|||
if (this.isNoteMutedOrBlocked(note)) return;
|
||||
|
||||
const clonedNote = await this.assignMyReaction(note);
|
||||
await this.hideNote(clonedNote);
|
||||
|
||||
this.connection.cacheNote(clonedNote);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue