This commit is contained in:
syuilo 2024-10-20 20:55:31 +09:00
parent 2c3170e626
commit f66eeb3b19
17 changed files with 32 additions and 32 deletions

8
locales/index.d.ts vendored
View File

@ -5198,19 +5198,19 @@ export interface Locale extends ILocale {
/**
*
*/
"signinRequiredForShowContents": string;
"requireSigninToViewContents": string;
/**
*
*/
"signinRequiredForShowContentsDescription1": string;
"requireSigninToViewContentsDescription1": string;
/**
* URLプレビュー(OGP)Webページへの埋め込み
*/
"signinRequiredForShowContentsDescription2": string;
"requireSigninToViewContentsDescription2": string;
/**
*
*/
"signinRequiredForShowContentsDescription3": string;
"requireSigninToViewContentsDescription3": string;
};
"_abuseUserReport": {
/**

View File

@ -1296,10 +1296,10 @@ yourNameContainsProhibitedWordsDescription: "名前に禁止されている文
thisContentsAreMarkedAsSigninRequiredByAuthor: "このコンテンツの閲覧にはログインが必要と作者によって設定されています"
_accountSettings:
signinRequiredForShowContents: "コンテンツの表示にログインを必須にする"
signinRequiredForShowContentsDescription1: "あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーから情報を収集されるのを防ぐ効果が期待できます。"
signinRequiredForShowContentsDescription2: "URLプレビュー(OGP)、Webページへの埋め込み、ートの引用に対応していないサーバーからの表示も不可になります。"
signinRequiredForShowContentsDescription3: "リモートサーバーに連合されたコンテンツにはこれらの制限は適用されません。"
requireSigninToViewContents: "コンテンツの表示にログインを必須にする"
requireSigninToViewContentsDescription1: "あなたが作成した全てのノートなどのコンテンツを表示するのにログインを必須にします。クローラーから情報を収集されるのを防ぐ効果が期待できます。"
requireSigninToViewContentsDescription2: "URLプレビュー(OGP)、Webページへの埋め込み、ートの引用に対応していないサーバーからの表示も不可になります。"
requireSigninToViewContentsDescription3: "リモートサーバーに連合されたコンテンツにはこれらの制限は適用されません。"
_abuseUserReport:
forward: "転送"

View File

@ -7,10 +7,10 @@ export class SigninRequiredForShowContents1729333924409 {
name = 'SigninRequiredForShowContents1729333924409'
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" ADD "signinRequiredForShowContents" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "user" ADD "requireSigninToViewContents" boolean NOT NULL DEFAULT false`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "signinRequiredForShowContents"`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "requireSigninToViewContents"`);
}
}

View File

@ -83,7 +83,7 @@ function generateDummyUser(override?: Partial<MiUser>): MiUser {
isExplorable: true,
isHibernated: false,
isDeleted: false,
signinRequiredForShowContents: false,
requireSigninToViewContents: false,
emojis: [],
score: 0,
host: null,

View File

@ -495,7 +495,7 @@ export class ApRendererService {
summary: profile.description ? this.mfmService.toHtml(mfm.parse(profile.description)) : null,
_misskey_summary: profile.description,
_misskey_followedMessage: profile.followedMessage,
_misskey_signinRequiredForShowContents: user.signinRequiredForShowContents,
_misskey_requireSigninToViewContents: user.requireSigninToViewContents,
icon: avatar ? this.renderImage(avatar) : null,
image: banner ? this.renderImage(banner) : null,
tag,

View File

@ -555,7 +555,7 @@ const extension_context_definition = {
'_misskey_votes': 'misskey:_misskey_votes',
'_misskey_summary': 'misskey:_misskey_summary',
'_misskey_followedMessage': 'misskey:_misskey_followedMessage',
'_misskey_signinRequiredForShowContents': 'misskey:_misskey_signinRequiredForShowContents',
'_misskey_requireSigninToViewContents': 'misskey:_misskey_requireSigninToViewContents',
'isCat': 'misskey:isCat',
// vcard
vcard: 'http://www.w3.org/2006/vcard/ns#',

View File

@ -356,7 +356,7 @@ export class ApPersonService implements OnModuleInit {
tags,
isBot,
isCat: (person as any).isCat === true,
signinRequiredForShowContents: (person as any).signinRequiredForShowContents === true,
requireSigninToViewContents: (person as any).requireSigninToViewContents === true,
emojis,
})) as MiRemoteUser;

View File

@ -14,7 +14,7 @@ export interface IObject {
summary?: string;
_misskey_summary?: string;
_misskey_followedMessage?: string | null;
_misskey_signinRequiredForShowContents?: boolean;
_misskey_requireSigninToViewContents?: boolean;
published?: string;
cc?: ApObject;
to?: ApObject;

View File

@ -149,7 +149,7 @@ export class NoteEntityService implements OnModuleInit {
}
}
if (packedNote.user.signinRequiredForShowContents && meId == null) {
if (packedNote.user.requireSigninToViewContents && meId == null) {
hide = true;
}

View File

@ -490,7 +490,7 @@ export class UserEntityService implements OnModuleInit {
}))) : [],
isBot: user.isBot,
isCat: user.isCat,
signinRequiredForShowContents: user.signinRequiredForShowContents === false ? undefined : true,
requireSigninToViewContents: user.requireSigninToViewContents === false ? undefined : true,
instance: user.host ? this.federatedInstanceService.federatedInstanceCache.fetch(user.host).then(instance => instance ? {
name: instance.name,
softwareName: instance.softwareName,

View File

@ -205,7 +205,7 @@ export class MiUser {
@Column('boolean', {
default: false,
})
public signinRequiredForShowContents: boolean;
public requireSigninToViewContents: boolean;
// アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ
@Column('boolean', {

View File

@ -115,7 +115,7 @@ export const packedUserLiteSchema = {
type: 'boolean',
nullable: false, optional: true,
},
signinRequiredForShowContents: {
requireSigninToViewContents: {
type: 'boolean',
nullable: false, optional: true,
},

View File

@ -179,7 +179,7 @@ export const paramDef = {
autoAcceptFollowed: { type: 'boolean' },
noCrawle: { type: 'boolean' },
preventAiLearning: { type: 'boolean' },
signinRequiredForShowContents: { type: 'boolean' },
requireSigninToViewContents: { type: 'boolean' },
isBot: { type: 'boolean' },
isCat: { type: 'boolean' },
injectFeaturedNote: { type: 'boolean' },
@ -335,7 +335,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (typeof ps.autoAcceptFollowed === 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed;
if (typeof ps.noCrawle === 'boolean') profileUpdates.noCrawle = ps.noCrawle;
if (typeof ps.preventAiLearning === 'boolean') profileUpdates.preventAiLearning = ps.preventAiLearning;
if (typeof ps.signinRequiredForShowContents === 'boolean') updates.signinRequiredForShowContents = ps.signinRequiredForShowContents;
if (typeof ps.requireSigninToViewContents === 'boolean') updates.requireSigninToViewContents = ps.requireSigninToViewContents;
if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail;

View File

@ -55,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw err;
});
if (note.user!.signinRequiredForShowContents && me == null) {
if (note.user!.requireSigninToViewContents && me == null) {
throw new ApiError(meta.errors.signinRequired);
}

View File

@ -609,7 +609,7 @@ export class ClientServerService {
relations: ['user'],
});
if (note && !note.user!.signinRequiredForShowContents) {
if (note && !note.user!.requireSigninToViewContents) {
const _note = await this.noteEntityService.pack(note);
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: note.userId });
reply.header('Cache-Control', 'public, max-age=15');

View File

@ -43,12 +43,12 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.makeExplorable }}
<template #caption>{{ i18n.ts.makeExplorableDescription }}</template>
</MkSwitch>
<MkSwitch v-model="signinRequiredForShowContents" @update:modelValue="save()">
{{ i18n.ts._accountSettings.signinRequiredForShowContents }}<span class="_beta">{{ i18n.ts.beta }}</span>
<MkSwitch v-model="requireSigninToViewContents" @update:modelValue="save()">
{{ i18n.ts._accountSettings.requireSigninToViewContents }}<span class="_beta">{{ i18n.ts.beta }}</span>
<template #caption>
<div>{{ i18n.ts._accountSettings.signinRequiredForShowContentsDescription1 }}</div>
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.signinRequiredForShowContentsDescription2 }}</div>
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.signinRequiredForShowContentsDescription3 }}</div>
<div>{{ i18n.ts._accountSettings.requireSigninToViewContentsDescription1 }}</div>
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription2 }}</div>
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
</template>
</MkSwitch>
@ -98,7 +98,7 @@ const autoAcceptFollowed = ref($i.autoAcceptFollowed);
const noCrawle = ref($i.noCrawle);
const preventAiLearning = ref($i.preventAiLearning);
const isExplorable = ref($i.isExplorable);
const signinRequiredForShowContents = ref($i.signinRequiredForShowContents ?? false);
const requireSigninToViewContents = ref($i.requireSigninToViewContents ?? false);
const hideOnlineStatus = ref($i.hideOnlineStatus);
const publicReactions = ref($i.publicReactions);
const followingVisibility = ref($i.followingVisibility);
@ -116,7 +116,7 @@ function save() {
noCrawle: !!noCrawle.value,
preventAiLearning: !!preventAiLearning.value,
isExplorable: !!isExplorable.value,
signinRequiredForShowContents: !!signinRequiredForShowContents.value,
requireSigninToViewContents: !!requireSigninToViewContents.value,
hideOnlineStatus: !!hideOnlineStatus.value,
publicReactions: !!publicReactions.value,
followingVisibility: followingVisibility.value,

View File

@ -3736,7 +3736,7 @@ export type components = {
}[];
isBot?: boolean;
isCat?: boolean;
signinRequiredForShowContents?: boolean;
requireSigninToViewContents?: boolean;
instance?: {
name: string | null;
softwareName: string | null;
@ -19845,7 +19845,7 @@ export type operations = {
autoAcceptFollowed?: boolean;
noCrawle?: boolean;
preventAiLearning?: boolean;
signinRequiredForShowContents?: boolean;
requireSigninToViewContents?: boolean;
isBot?: boolean;
isCat?: boolean;
injectFeaturedNote?: boolean;