summaryrefslogtreecommitdiff
path: root/src/server/api/stream/channels/hybrid-timeline.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/stream/channels/hybrid-timeline.ts')
-rw-r--r--src/server/api/stream/channels/hybrid-timeline.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/api/stream/channels/hybrid-timeline.ts b/src/server/api/stream/channels/hybrid-timeline.ts
index 5c454764ec..51f95fc0cd 100644
--- a/src/server/api/stream/channels/hybrid-timeline.ts
+++ b/src/server/api/stream/channels/hybrid-timeline.ts
@@ -3,10 +3,9 @@ import { isMutedUserRelated } from '@/misc/is-muted-user-related';
import Channel from '../channel';
import { fetchMeta } from '@/misc/fetch-meta';
import { Notes } from '@/models/index';
-import { PackedNote } from '@/models/repositories/note';
-import { PackedUser } from '@/models/repositories/user';
import { checkWordMute } from '@/misc/check-word-mute';
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
+import { Packed } from '@/misc/schema';
export default class extends Channel {
public readonly chName = 'hybridTimeline';
@@ -23,7 +22,7 @@ export default class extends Channel {
}
@autobind
- private async onNote(note: PackedNote) {
+ private async onNote(note: Packed<'Note'>) {
// チャンネルの投稿ではなく、自分自身の投稿 または
// チャンネルの投稿ではなく、その投稿のユーザーをフォローしている または
// チャンネルの投稿ではなく、全体公開のローカルの投稿 または
@@ -31,7 +30,7 @@ export default class extends Channel {
if (!(
(note.channelId == null && this.user!.id === note.userId) ||
(note.channelId == null && this.following.has(note.userId)) ||
- (note.channelId == null && ((note.user as PackedUser).host == null && note.visibility === 'public')) ||
+ (note.channelId == null && (note.user.host == null && note.visibility === 'public')) ||
(note.channelId != null && this.followingChannels.has(note.channelId))
)) return;
@@ -60,7 +59,7 @@ export default class extends Channel {
// 関係ない返信は除外
if (note.reply) {
- const reply = note.reply as PackedNote;
+ const reply = note.reply;
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
}