summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-04-08 20:50:38 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-04-08 20:50:38 +0900
commitc500e4392aac643ccf05d28effabbf41c1c37e9b (patch)
tree38fa75094b41e5a3151e9f824f049350d5078cc6
parentNew Crowdin updates (#15776) (diff)
downloadsharkey-c500e4392aac643ccf05d28effabbf41c1c37e9b.tar.gz
sharkey-c500e4392aac643ccf05d28effabbf41c1c37e9b.tar.bz2
sharkey-c500e4392aac643ccf05d28effabbf41c1c37e9b.zip
hideNotesInSensitiveChannel -> excludeNotesInSensitiveChannel
-rw-r--r--locales/index.d.ts2
-rw-r--r--packages/backend/migration/1744075766000-excludeNotesInSensitiveChannel.js16
-rw-r--r--packages/backend/src/core/AntennaService.ts2
-rw-r--r--packages/backend/src/core/entities/AntennaEntityService.ts2
-rw-r--r--packages/backend/src/models/Antenna.ts2
-rw-r--r--packages/backend/src/models/json-schema/antenna.ts2
-rw-r--r--packages/backend/src/server/api/endpoints/antennas/create.ts4
-rw-r--r--packages/backend/src/server/api/endpoints/antennas/update.ts4
-rw-r--r--packages/backend/test/e2e/antennas.ts8
-rw-r--r--packages/frontend/src/components/MkAntennaEditor.vue10
-rw-r--r--packages/misskey-js/src/autogen/types.ts6
11 files changed, 37 insertions, 21 deletions
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 494caf49cc..13e838205a 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -1717,7 +1717,7 @@ export interface Locale extends ILocale {
/**
* センシティブなチャンネルのノートを非表示
*/
- "hideNotesInSensitiveChannel": string;
+ "excludeNotesInSensitiveChannel": string;
/**
* ブラウザへのプッシュ通知を有効にする
*/
diff --git a/packages/backend/migration/1744075766000-excludeNotesInSensitiveChannel.js b/packages/backend/migration/1744075766000-excludeNotesInSensitiveChannel.js
new file mode 100644
index 0000000000..1e8faafbc4
--- /dev/null
+++ b/packages/backend/migration/1744075766000-excludeNotesInSensitiveChannel.js
@@ -0,0 +1,16 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+export class ExcludeNotesInSensitiveChannel1744075766000 {
+ name = 'ExcludeNotesInSensitiveChannel1744075766000'
+
+ async up(queryRunner) {
+ await queryRunner.query(`ALTER TABLE "antenna" RENAME COLUMN "hideNotesInSensitiveChannel" TO "excludeNotesInSensitiveChannel"`);
+ }
+
+ async down(queryRunner) {
+ await queryRunner.query(`ALTER TABLE "antenna" RENAME COLUMN "excludeNotesInSensitiveChannel" TO "hideNotesInSensitiveChannel"`);
+ }
+}
diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts
index 5ad5bcf72a..828cf4f706 100644
--- a/packages/backend/src/core/AntennaService.ts
+++ b/packages/backend/src/core/AntennaService.ts
@@ -114,7 +114,7 @@ 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.excludeNotesInSensitiveChannel && note.channel?.isSensitive) return false;
if (antenna.excludeBots && noteUser.isBot) return false;
diff --git a/packages/backend/src/core/entities/AntennaEntityService.ts b/packages/backend/src/core/entities/AntennaEntityService.ts
index e81c1e8db4..1f8c8ae3e8 100644
--- a/packages/backend/src/core/entities/AntennaEntityService.ts
+++ b/packages/backend/src/core/entities/AntennaEntityService.ts
@@ -41,7 +41,7 @@ export class AntennaEntityService {
excludeBots: antenna.excludeBots,
withReplies: antenna.withReplies,
withFile: antenna.withFile,
- hideNotesInSensitiveChannel: antenna.hideNotesInSensitiveChannel,
+ excludeNotesInSensitiveChannel: antenna.excludeNotesInSensitiveChannel,
isActive: antenna.isActive,
hasUnreadNote: false, // TODO
notify: false, // 後方互換性のため
diff --git a/packages/backend/src/models/Antenna.ts b/packages/backend/src/models/Antenna.ts
index 0d92c5cade..17ec0c0f79 100644
--- a/packages/backend/src/models/Antenna.ts
+++ b/packages/backend/src/models/Antenna.ts
@@ -104,5 +104,5 @@ export class MiAntenna {
@Column('boolean', {
default: false,
})
- public hideNotesInSensitiveChannel: boolean;
+ public excludeNotesInSensitiveChannel: boolean;
}
diff --git a/packages/backend/src/models/json-schema/antenna.ts b/packages/backend/src/models/json-schema/antenna.ts
index 2bdaca80d0..eca7563066 100644
--- a/packages/backend/src/models/json-schema/antenna.ts
+++ b/packages/backend/src/models/json-schema/antenna.ts
@@ -100,7 +100,7 @@ export const packedAntennaSchema = {
optional: false, nullable: false,
default: false,
},
- hideNotesInSensitiveChannel: {
+ excludeNotesInSensitiveChannel: {
type: 'boolean',
optional: false, nullable: false,
default: false,
diff --git a/packages/backend/src/server/api/endpoints/antennas/create.ts b/packages/backend/src/server/api/endpoints/antennas/create.ts
index 9b34b52b16..c075608491 100644
--- a/packages/backend/src/server/api/endpoints/antennas/create.ts
+++ b/packages/backend/src/server/api/endpoints/antennas/create.ts
@@ -73,7 +73,7 @@ export const paramDef = {
excludeBots: { type: 'boolean' },
withReplies: { type: 'boolean' },
withFile: { type: 'boolean' },
- hideNotesInSensitiveChannel: { type: 'boolean' },
+ excludeNotesInSensitiveChannel: { type: 'boolean' },
},
required: ['name', 'src', 'keywords', 'excludeKeywords', 'users', 'caseSensitive', 'withReplies', 'withFile'],
} as const;
@@ -134,7 +134,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
excludeBots: ps.excludeBots,
withReplies: ps.withReplies,
withFile: ps.withFile,
- hideNotesInSensitiveChannel: ps.hideNotesInSensitiveChannel,
+ excludeNotesInSensitiveChannel: ps.excludeNotesInSensitiveChannel,
});
this.globalEventService.publishInternalEvent('antennaCreated', antenna);
diff --git a/packages/backend/src/server/api/endpoints/antennas/update.ts b/packages/backend/src/server/api/endpoints/antennas/update.ts
index c5ddefebf7..53fc4db1b7 100644
--- a/packages/backend/src/server/api/endpoints/antennas/update.ts
+++ b/packages/backend/src/server/api/endpoints/antennas/update.ts
@@ -72,7 +72,7 @@ export const paramDef = {
excludeBots: { type: 'boolean' },
withReplies: { type: 'boolean' },
withFile: { type: 'boolean' },
- hideNotesInSensitiveChannel: { type: 'boolean' },
+ excludeNotesInSensitiveChannel: { type: 'boolean' },
},
required: ['antennaId'],
} as const;
@@ -130,7 +130,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
excludeBots: ps.excludeBots,
withReplies: ps.withReplies,
withFile: ps.withFile,
- hideNotesInSensitiveChannel: ps.hideNotesInSensitiveChannel,
+ excludeNotesInSensitiveChannel: ps.excludeNotesInSensitiveChannel,
isActive: true,
lastUsedAt: new Date(),
});
diff --git a/packages/backend/test/e2e/antennas.ts b/packages/backend/test/e2e/antennas.ts
index eb9583ee01..a84ff372b4 100644
--- a/packages/backend/test/e2e/antennas.ts
+++ b/packages/backend/test/e2e/antennas.ts
@@ -146,7 +146,7 @@ describe('アンテナ', () => {
caseSensitive: false,
createdAt: new Date(response.createdAt).toISOString(),
excludeKeywords: [['']],
- hideNotesInSensitiveChannel: false,
+ excludeNotesInSensitiveChannel: false,
hasUnreadNote: false,
isActive: true,
keywords: [['keyword']],
@@ -218,8 +218,8 @@ describe('アンテナ', () => {
{ parameters: () => ({ withReplies: true }) },
{ parameters: () => ({ withFile: false }) },
{ parameters: () => ({ withFile: true }) },
- { parameters: () => ({ hideNotesInSensitiveChannel: false }) },
- { parameters: () => ({ hideNotesInSensitiveChannel: true }) },
+ { parameters: () => ({ excludeNotesInSensitiveChannel: false }) },
+ { parameters: () => ({ excludeNotesInSensitiveChannel: true }) },
];
test.each(antennaParamPattern)('を作成できること($#)', async ({ parameters }) => {
const response = await successfulApiCall({
@@ -633,7 +633,7 @@ describe('アンテナ', () => {
const keyword = 'キーワード';
const antenna = await successfulApiCall({
endpoint: 'antennas/create',
- parameters: { ...defaultParam, keywords: [[keyword]], hideNotesInSensitiveChannel: true },
+ parameters: { ...defaultParam, keywords: [[keyword]], excludeNotesInSensitiveChannel: true },
user: alice,
});
const nonSensitiveChannel = await successfulApiCall({
diff --git a/packages/frontend/src/components/MkAntennaEditor.vue b/packages/frontend/src/components/MkAntennaEditor.vue
index e1c8200b73..91a375bbcd 100644
--- a/packages/frontend/src/components/MkAntennaEditor.vue
+++ b/packages/frontend/src/components/MkAntennaEditor.vue
@@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="localOnly">{{ i18n.ts.localOnly }}</MkSwitch>
<MkSwitch v-model="caseSensitive">{{ i18n.ts.caseSensitive }}</MkSwitch>
<MkSwitch v-model="withFile">{{ i18n.ts.withFileAntenna }}</MkSwitch>
- <MkSwitch v-model="hideNotesInSensitiveChannel">{{ i18n.ts.hideNotesInSensitiveChannel }}</MkSwitch>
+ <MkSwitch v-model="excludeNotesInSensitiveChannel">{{ i18n.ts.hideNotesInSensitiveChannel }}</MkSwitch>
</div>
<div :class="$style.actions">
<div class="_buttons">
@@ -54,6 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
+import type { DeepPartial } from '@/utility/merge.js';
import MkButton from '@/components/MkButton.vue';
import MkInput from '@/components/MkInput.vue';
import MkTextarea from '@/components/MkTextarea.vue';
@@ -63,7 +64,6 @@ import * as os from '@/os.js';
import { misskeyApi } from '@/utility/misskey-api.js';
import { i18n } from '@/i18n.js';
import { deepMerge } from '@/utility/merge.js';
-import type { DeepPartial } from '@/utility/merge.js';
type PartialAllowedAntenna = Omit<Misskey.entities.Antenna, 'id' | 'createdAt' | 'updatedAt'> & {
id?: string;
@@ -87,7 +87,7 @@ const initialAntenna = deepMerge<PartialAllowedAntenna>(props.antenna ?? {}, {
caseSensitive: false,
localOnly: false,
withFile: false,
- hideNotesInSensitiveChannel: false,
+ excludeNotesInSensitiveChannel: false,
isActive: true,
hasUnreadNote: false,
notify: false,
@@ -110,7 +110,7 @@ const localOnly = ref<boolean>(initialAntenna.localOnly);
const excludeBots = ref<boolean>(initialAntenna.excludeBots);
const withReplies = ref<boolean>(initialAntenna.withReplies);
const withFile = ref<boolean>(initialAntenna.withFile);
-const hideNotesInSensitiveChannel = ref<boolean>(initialAntenna.hideNotesInSensitiveChannel);
+const excludeNotesInSensitiveChannel = ref<boolean>(initialAntenna.excludeNotesInSensitiveChannel);
const userLists = ref<Misskey.entities.UserList[] | null>(null);
watch(() => src.value, async () => {
@@ -127,7 +127,7 @@ async function saveAntenna() {
excludeBots: excludeBots.value,
withReplies: withReplies.value,
withFile: withFile.value,
- hideNotesInSensitiveChannel: hideNotesInSensitiveChannel.value,
+ excludeNotesInSensitiveChannel: excludeNotesInSensitiveChannel.value,
caseSensitive: caseSensitive.value,
localOnly: localOnly.value,
users: users.value.trim().split('\n').map(x => x.trim()),
diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts
index 6cc55507c0..a9b04c67c8 100644
--- a/packages/misskey-js/src/autogen/types.ts
+++ b/packages/misskey-js/src/autogen/types.ts
@@ -4899,7 +4899,7 @@ export type components = {
/** @default false */
notify: boolean;
/** @default false */
- hideNotesInSensitiveChannel: boolean;
+ excludeNotesInSensitiveChannel: boolean;
};
Clip: {
/**
@@ -11340,7 +11340,7 @@ export type operations = {
excludeBots?: boolean;
withReplies: boolean;
withFile: boolean;
- hideNotesInSensitiveChannel?: boolean;
+ excludeNotesInSensitiveChannel?: boolean;
};
};
};
@@ -11622,7 +11622,7 @@ export type operations = {
excludeBots?: boolean;
withReplies?: boolean;
withFile?: boolean;
- hideNotesInSensitiveChannel?: boolean;
+ excludeNotesInSensitiveChannel?: boolean;
};
};
};