From 5929f14c6a7354b73b2bc12eae70864f95def0cd Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 18 Feb 2024 23:06:52 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20syuilo/misskey=E6=99=82=E4=BB=A3?= =?UTF-8?q?=E3=81=8B=E3=82=89=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=A6=E3=82=8B?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=83=90=E3=83=BC=E3=81=8C=E6=94=B9=E5=A4=89?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=A0=E3=81=A8=E3=81=94=E5=88=A4=E5=AE=9A=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ packages/frontend/src/boot/main-boot.ts | 3 ++- packages/frontend/src/pages/about-misskey.vue | 3 ++- .../src/scripts/isOriginalMisskeyRepositoryUrl.ts | 9 +++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 packages/frontend/src/scripts/isOriginalMisskeyRepositoryUrl.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 32c9bd0aec9f..bbd7dbacab36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,15 @@ --> +## 202x.x.x (unreleased) + +### General + +### Client +- Fix: レポジトリurlがhttps://github.com/syuilo/misskeyのときに改変されたバージョンであるとご認識される問題 + +### Server + ## 2024.2.0 ### Note diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index b19d45a35e87..b6ed65e4ad32 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -21,6 +21,7 @@ import { initializeSw } from '@/scripts/initialize-sw.js'; import { deckStore } from '@/ui/deck/deck-store.js'; import { emojiPicker } from '@/scripts/emoji-picker.js'; import { mainRouter } from '@/router/main.js'; +import { isOriginalMisskeyRepositoryUrl } from '@/scripts/isOriginalMisskeyRepositoryUrl.js'; export async function mainBoot() { const { isClientUpdated } = await common(() => createApp( @@ -237,7 +238,7 @@ export async function mainBoot() { fetchInstance().then(() => { const modifiedVersionMustProminentlyOfferInAgplV3Section13Read = miLocalStorage.getItem('modifiedVersionMustProminentlyOfferInAgplV3Section13Read'); - if (modifiedVersionMustProminentlyOfferInAgplV3Section13Read !== 'true' && instance.repositoryUrl !== 'https://github.com/misskey-dev/misskey') { + if (modifiedVersionMustProminentlyOfferInAgplV3Section13Read !== 'true' && !isOriginalMisskeyRepositoryUrl(instance.repositoryUrl)) { popup(defineAsyncComponent(() => import('@/components/MkSourceCodeAvailablePopup.vue')), {}, {}, 'closed'); } }); diff --git a/packages/frontend/src/pages/about-misskey.vue b/packages/frontend/src/pages/about-misskey.vue index fd97ab97b919..92935890919f 100644 --- a/packages/frontend/src/pages/about-misskey.vue +++ b/packages/frontend/src/pages/about-misskey.vue @@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only - +
{{ i18n.tsx._aboutMisskey.thisIsModifiedVersion({ name: instance.name }) }} @@ -146,6 +146,7 @@ import * as os from '@/os.js'; import { definePageMetadata } from '@/scripts/page-metadata.js'; import { claimAchievement, claimedAchievements } from '@/scripts/achievements.js'; import { $i } from '@/account.js'; +import { isOriginalMisskeyRepositoryUrl } from '@/scripts/isOriginalMisskeyRepositoryUrl.js'; const patronsWithIcon = [{ name: 'カイヤン', diff --git a/packages/frontend/src/scripts/isOriginalMisskeyRepositoryUrl.ts b/packages/frontend/src/scripts/isOriginalMisskeyRepositoryUrl.ts new file mode 100644 index 000000000000..8ca76cf61b4b --- /dev/null +++ b/packages/frontend/src/scripts/isOriginalMisskeyRepositoryUrl.ts @@ -0,0 +1,9 @@ + +const originalMisskeyRepositoryUrls: string[] = [ + 'https://github.com/misskey-dev/misskey', + 'https://github.com/syuilo/misskey', +]; + +export function isOriginalMisskeyRepositoryUrl(url: string | null): boolean { + return url != null && originalMisskeyRepositoryUrls.includes(url); +}