summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream
diff options
context:
space:
mode:
authornenohi <kimutipartylove@gmail.com>2023-05-19 17:12:22 +0900
committerGitHub <noreply@github.com>2023-05-19 17:12:22 +0900
commitbd6666173a266dbcc10221a049f518443ed8f25b (patch)
treeb43bce02a22328c73edc26081ee6f6c6ecec36c1 /packages/backend/src/server/api/stream
parentupdate pnpm to 8.5.1 (diff)
downloadmisskey-bd6666173a266dbcc10221a049f518443ed8f25b.tar.gz
misskey-bd6666173a266dbcc10221a049f518443ed8f25b.tar.bz2
misskey-bd6666173a266dbcc10221a049f518443ed8f25b.zip
fix:ロールタイムライン無効に関する修正 (#10843)
* 修正 * note visibility change * public投稿のみ * update changelog * RN非表示機能がうごかないところだった
Diffstat (limited to 'packages/backend/src/server/api/stream')
-rw-r--r--packages/backend/src/server/api/stream/channels/role-timeline.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/backend/src/server/api/stream/channels/role-timeline.ts b/packages/backend/src/server/api/stream/channels/role-timeline.ts
index 9d106c8b2f..ab9c1aa0b5 100644
--- a/packages/backend/src/server/api/stream/channels/role-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/role-timeline.ts
@@ -5,15 +5,17 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { bindThis } from '@/decorators.js';
import Channel from '../channel.js';
import { StreamMessages } from '../types.js';
+import { RoleService } from '@/core/RoleService.js';
class RoleTimelineChannel extends Channel {
public readonly chName = 'roleTimeline';
public static shouldShare = false;
public static requireCredential = false;
private roleId: string;
-
+
constructor(
private noteEntityService: NoteEntityService,
+ private roleservice: RoleService,
id: string,
connection: Channel['connection'],
@@ -34,6 +36,11 @@ class RoleTimelineChannel extends Channel {
if (data.type === 'note') {
const note = data.body;
+ if (!(await this.roleservice.isExplorable({ id: this.roleId }))) {
+ return;
+ }
+ if (note.visibility !== 'public') return;
+
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
@@ -61,6 +68,7 @@ export class RoleTimelineChannelService {
constructor(
private noteEntityService: NoteEntityService,
+ private roleservice: RoleService,
) {
}
@@ -68,6 +76,7 @@ export class RoleTimelineChannelService {
public create(id: string, connection: Channel['connection']): RoleTimelineChannel {
return new RoleTimelineChannel(
this.noteEntityService,
+ this.roleservice,
id,
connection,
);