mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 12:14:18 +00:00
call NoteEntityService.hideNote from streaming API
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user