fix(backend): 自分のフォローしているユーザーの自分のフォローしていないユーザーの visibility: followers な投稿への返信がストリーミングで流れてくる問題を修正
Fix #12117
This commit is contained in:
		| @@ -59,11 +59,15 @@ class HomeTimelineChannel extends Channel { | ||||
| 			if (!note.visibleUserIds!.includes(this.user!.id)) return; | ||||
| 		} | ||||
|  | ||||
| 		// 関係ない返信は除外 | ||||
| 		if (note.reply && !this.following[note.userId]?.withReplies) { | ||||
| 		if (note.reply) { | ||||
| 			const reply = note.reply; | ||||
| 			// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 			if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			if (this.following[note.userId]?.withReplies) { | ||||
| 				// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く | ||||
| 				if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return; | ||||
| 			} else { | ||||
| 				// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 				if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; | ||||
|   | ||||
| @@ -73,11 +73,15 @@ class HybridTimelineChannel extends Channel { | ||||
| 		// Ignore notes from instances the user has muted | ||||
| 		if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances))) return; | ||||
|  | ||||
| 		// 関係ない返信は除外 | ||||
| 		if (note.reply && !this.following[note.userId]?.withReplies && !this.withReplies) { | ||||
| 		if (note.reply) { | ||||
| 			const reply = note.reply; | ||||
| 			// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 			if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			if ((this.following[note.userId]?.withReplies ?? false) || this.withReplies) { | ||||
| 				// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く | ||||
| 				if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return; | ||||
| 			} else { | ||||
| 				// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 				if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; | ||||
|   | ||||
| @@ -90,11 +90,15 @@ class UserListChannel extends Channel { | ||||
| 			if (!note.visibleUserIds!.includes(this.user!.id)) return; | ||||
| 		} | ||||
|  | ||||
| 		// 関係ない返信は除外 | ||||
| 		if (note.reply && !this.membershipsMap[note.userId]?.withReplies) { | ||||
| 		if (note.reply) { | ||||
| 			const reply = note.reply; | ||||
| 			// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 			if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			if (this.membershipsMap[note.userId]?.withReplies) { | ||||
| 				// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く | ||||
| 				if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return; | ||||
| 			} else { | ||||
| 				// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 | ||||
| 				if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo