Skip to content

Commit

Permalink
fix: if withReplies is false for the user in following, note is remov…
Browse files Browse the repository at this point in the history
…ed from vmimi-relay-timeline
  • Loading branch information
anatawa12 committed Apr 12, 2024
1 parent 312340c commit 613a6f8
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,16 @@ class VmimiRelayTimelineChannel extends Channel {
if (note.visibility !== 'public') return;
if (note.channelId != null) return;

// 関係ない返信は除外
if (note.reply && !this.following[note.userId]?.withReplies) {
const reply = note.reply;
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
}

if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;

// Ignore notes from non-vmimi relay
if (!this.vmimiRelayTimelineService.isRelayedInstance(note.user.host ?? null)) return;
if (!this.withReplies && note.reply) {
if (!this.vmimiRelayTimelineService.isRelayedInstance(note.reply.user.host ?? null)) return;
}

// Ignore notes from instances the user has muted
if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return;

// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
Expand Down

0 comments on commit 613a6f8

Please sign in to comment.