check tenants before showing "remote user" warning
This commit is contained in:
parent
aa8a1e8440
commit
5af1197f75
5 changed files with 17 additions and 3 deletions
|
@ -185,6 +185,10 @@ export class MetaEntityService {
|
|||
miauth: true,
|
||||
},
|
||||
allowUnsignedFetch: instance.allowUnsignedFetch,
|
||||
localHosts: [
|
||||
null,
|
||||
...this.config.alts.map(alt => this.utilityService.toPuny(alt.host)),
|
||||
],
|
||||
};
|
||||
|
||||
return packDetailed;
|
||||
|
|
|
@ -436,6 +436,14 @@ export const packedMetaDetailedOnlySchema = {
|
|||
enum: instanceUnsignedFetchOptions,
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
localHosts: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkButton rounded :class="$style.loadButton" @click="showNext = 'user'"><i class="ti ti-chevron-up"></i> <i class="ti ti-user"></i></MkButton>
|
||||
</div>
|
||||
<div class="_margin _gaps_s">
|
||||
<MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
|
||||
<MkRemoteCaution v-if="!instance.localHosts.includes(note.user.host)" :href="note.url ?? note.uri"/>
|
||||
<SkErrorList :errors="note.processErrors"/>
|
||||
<DynamicNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note" :expandAllCws="expandAllCws"/>
|
||||
</div>
|
||||
|
@ -67,6 +67,7 @@ import { pleaseLogin } from '@/utility/please-login.js';
|
|||
import { getAppearNote } from '@/utility/get-appear-note.js';
|
||||
import { serverContext, assertServerContext } from '@/server-context.js';
|
||||
import { $i } from '@/i.js';
|
||||
import { instance } from '@/instance.js';
|
||||
|
||||
// contextは非ログイン状態の情報しかないためログイン時は利用できない
|
||||
const CTX_NOTE = !$i && assertServerContext(serverContext, 'note') ? serverContext.note : null;
|
||||
|
|
|
@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<div class="profile _gaps">
|
||||
<MkAccountMoved v-if="user.movedTo" :movedTo="user.movedTo"/>
|
||||
<MkRemoteCaution v-if="user.host != null" :href="user.url ?? user.uri!"/>
|
||||
<MkRemoteCaution v-if="!instance.localHosts.includes(user.host)" :href="user.url ?? user.uri!"/>
|
||||
<MkInfo v-if="user.host == null && user.username.includes('.')">{{ i18n.ts.isSystemAccount }}</MkInfo>
|
||||
|
||||
<div :key="user.id" class="main _panel">
|
||||
|
@ -218,7 +218,7 @@ import { misskeyApi } from '@/utility/misskey-api.js';
|
|||
import { isFollowingVisibleForMe, isFollowersVisibleForMe } from '@/utility/isFfVisibleForMe.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
import { getStaticImageUrl } from '@/utility/media-proxy.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { infoImageUrl, instance } from '@/instance.js';
|
||||
import MkSparkle from '@/components/MkSparkle.vue';
|
||||
import { prefer } from '@/preferences.js';
|
||||
import DynamicNote from '@/components/DynamicNote.vue';
|
||||
|
|
|
@ -5653,6 +5653,7 @@ export type components = {
|
|||
cacheRemoteSensitiveFiles: boolean;
|
||||
/** @enum {string} */
|
||||
allowUnsignedFetch: 'never' | 'always' | 'essential';
|
||||
localHosts: (string | null)[];
|
||||
};
|
||||
MetaDetailed: components['schemas']['MetaLite'] & components['schemas']['MetaDetailedOnly'];
|
||||
SystemWebhook: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue