summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorNanashi. <sevenc7c@sevenc7c.com>2025-04-02 16:01:24 +0900
committerGitHub <noreply@github.com>2025-04-02 16:01:24 +0900
commit98eadd709364a11f039a8d45a2498ec6c8226c46 (patch)
tree1f0af7c1071e0641e44e1b0896785dea7d9e1fa9 /packages/backend/src/core
parentenhance: implement `sentryForFrontend` (#15433) (diff)
downloadmisskey-98eadd709364a11f039a8d45a2498ec6c8226c46.tar.gz
misskey-98eadd709364a11f039a8d45a2498ec6c8226c46.tar.bz2
misskey-98eadd709364a11f039a8d45a2498ec6c8226c46.zip
feat: アンテナでセンシティブなチャンネルからのノートを除外できるように (#15346)
* feat(db): マイグレーションを追加 * feat(backend): カラムの定義を追加 * wip * feat: フラグを設定出来るように * feat: /notesエンドポイントを対応 * feat: websocketを対応 * test: テストを追加 * docs: CHANGELOGを更新 * docs: CHANGELOGの追加場所を修正 * chore: api.jsonを更新 * docs(CHANGELOG): General欄に移動 * docs: フォーマットを揃える * chore: クエリを削除 * revert: 英訳を消す * chore: note.channelを追加するところを変える * docs: CHANGELOGを更新する * docs(CHANGELOG): 2025.3.2に移動 * chore: changelogを下に移動 * ci: CI再実行用の空コミット --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/AntennaService.ts2
-rw-r--r--packages/backend/src/core/NoteCreateService.ts5
-rw-r--r--packages/backend/src/core/entities/AntennaEntityService.ts1
3 files changed, 7 insertions, 1 deletions
diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts
index e827ffa68c..5ad5bcf72a 100644
--- a/packages/backend/src/core/AntennaService.ts
+++ b/packages/backend/src/core/AntennaService.ts
@@ -114,6 +114,8 @@ export class AntennaService implements OnApplicationShutdown {
if (note.visibility === 'specified') return false;
if (note.visibility === 'followers') return false;
+ if (antenna.hideNotesInSensitiveChannel && note.channel?.isSensitive) return false;
+
if (antenna.excludeBots && noteUser.isBot) return false;
if (antenna.localOnly && noteUser.host != null) return false;
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 8f416f398c..1ddb2b173d 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -532,7 +532,10 @@ export class NoteCreateService implements OnApplicationShutdown {
this.pushToTl(note, user);
- this.antennaService.addNoteToAntennas(note, user);
+ this.antennaService.addNoteToAntennas({
+ ...note,
+ channel: data.channel ?? null,
+ }, user);
if (data.reply) {
this.saveReply(data.reply, note);
diff --git a/packages/backend/src/core/entities/AntennaEntityService.ts b/packages/backend/src/core/entities/AntennaEntityService.ts
index e770028af3..e81c1e8db4 100644
--- a/packages/backend/src/core/entities/AntennaEntityService.ts
+++ b/packages/backend/src/core/entities/AntennaEntityService.ts
@@ -41,6 +41,7 @@ export class AntennaEntityService {
excludeBots: antenna.excludeBots,
withReplies: antenna.withReplies,
withFile: antenna.withFile,
+ hideNotesInSensitiveChannel: antenna.hideNotesInSensitiveChannel,
isActive: antenna.isActive,
hasUnreadNote: false, // TODO
notify: false, // 後方互換性のため