From af6ad497441b3ae4332fd4f2610bbc805ab768c5 Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Sat, 21 Dec 2024 19:44:20 +0900 Subject: [PATCH 01/14] =?UTF-8?q?Fix(frontend):=20=E3=83=8E=E3=83=BC?= =?UTF-8?q?=E3=83=88=E8=A9=B3=E7=B4=B0=E7=94=BB=E9=9D=A2=E3=81=A7=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E5=87=BA=E6=9D=A5?= =?UTF-8?q?=E3=81=AA=E3=81=84=20(#584)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 16 ++++++++++++++++ .../frontend/src/components/MkNoteDetailed.vue | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index ff6ab1c5a3..cc47dc04b9 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -1,3 +1,19 @@ +## 1.2.2 +Cherrypick 4.13.0 +Misskey 2024.10.1 + +### Release Date +xxxx-xx-xx + +### General +- + +### Client +- Fix: ノート詳細画面でリアクション出来ない [#584](https://github.com/yojo-art/cherrypick/pull/584) + +### Server +- + ## 1.2.1 Cherrypick 4.13.0 Misskey 2024.10.1 diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 1a43490640..e6f4452afa 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -201,7 +201,7 @@ SPDX-License-Identifier: AGPL-3.0-only - + From 034a45e22e36630a01fcf9db07fb788e3d7aa7d0 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:16:31 +0900 Subject: [PATCH 02/14] =?UTF-8?q?MFM=E3=83=81=E3=83=BC=E3=83=88=E3=82=B7?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=84=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 1 + .../frontend/src/pages/mfc-cheat-sheet.vue | 78 +++++++++---------- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index cc47dc04b9..53597eef90 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -10,6 +10,7 @@ xxxx-xx-xx ### Client - Fix: ノート詳細画面でリアクション出来ない [#584](https://github.com/yojo-art/cherrypick/pull/584) +- Fix: MFMチートシートが表示できない不具合を修正 [#592](https://github.com/yojo-art/cherrypick/pull/592) ### Server - diff --git a/packages/frontend/src/pages/mfc-cheat-sheet.vue b/packages/frontend/src/pages/mfc-cheat-sheet.vue index 23bf1face2..f9edc90619 100644 --- a/packages/frontend/src/pages/mfc-cheat-sheet.vue +++ b/packages/frontend/src/pages/mfc-cheat-sheet.vue @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.mentionDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.hashtagDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -35,7 +35,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.urlDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.linkDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -55,7 +55,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.emojiDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.boldDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -75,7 +75,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.smallDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -85,7 +85,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.quoteDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -95,7 +95,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.centerDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -105,7 +105,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.inlineCodeDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -115,7 +115,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.blockCodeDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -125,7 +125,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.inlineMathDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -135,7 +135,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.blockMathDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -145,7 +145,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.searchDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -155,7 +155,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.flipDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -165,7 +165,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.fontDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -175,7 +175,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.x2Description }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -185,7 +185,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.x3Description }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -195,7 +195,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.x4Description }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -205,7 +205,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.blurDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -215,7 +215,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.jellyDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -225,7 +225,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.tadaDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -235,7 +235,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.jumpDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -245,7 +245,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.bounceDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -255,7 +255,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.spinDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -265,7 +265,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.shakeDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -275,7 +275,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.twitchDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -285,7 +285,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.rainbowDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -295,7 +295,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.sparkleDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -305,7 +305,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.fadeDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -315,7 +315,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.rotateDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -325,7 +325,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.positionDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -335,7 +335,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.scaleDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -345,7 +345,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.fgDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -355,7 +355,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.bgDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -365,7 +365,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.plainDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} @@ -375,15 +375,15 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._mfc.rubyDescription }} - MFC {{ i18n.ts.sample }} + MFM {{ i18n.ts.sample }} - {{ i18n.ts._mfm.border }} + {{ i18n.ts._mfc.border }} - {{ i18n.ts._mfm.borderDescription }} + {{ i18n.ts._mfc.borderDescription }} MFM {{ i18n.ts.sample }} From 7f72cf91926fd9571275b6fecaf58bc153745d45 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:18:43 +0900 Subject: [PATCH 03/14] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=A7=E8=A1=A8=E7=A4=BA=E6=9C=89=E7=84=A1=E9=81=B8=E6=8A=9E?= =?UTF-8?q?=E3=81=AE=E9=81=B8=E6=8A=9E=E8=82=A2=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#590)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 1 + packages/frontend/src/pages/timeline.vue | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 53597eef90..c2450bbeb4 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -10,6 +10,7 @@ xxxx-xx-xx ### Client - Fix: ノート詳細画面でリアクション出来ない [#584](https://github.com/yojo-art/cherrypick/pull/584) +- Fix: タイムラインオプションで表示有無選択の選択肢を修正 [#590](https://github.com/yojo-art/cherrypick/pull/590) - Fix: MFMチートシートが表示できない不具合を修正 [#592](https://github.com/yojo-art/cherrypick/pull/592) ### Server diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index bf6aed63e4..02a6aaf70b 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -176,7 +176,7 @@ const enableSocialTimeline = ref(defaultStore.state.enableSocialTimeline); const enableGlobalTimeline = ref(defaultStore.state.enableGlobalTimeline); const enableListTimeline = ref(defaultStore.state.enableListTimeline); const enableAntennaTimeline = ref(defaultStore.state.enableAntennaTimeline); -const enableChannelTimeline = ref(defaultStore.state.enableChannelTimeline); +const enableTagTimeline = ref(defaultStore.state.enableTagTimeline); const collapseRenotes = ref(defaultStore.state.collapseRenotes); const collapseReplies = ref(defaultStore.state.collapseReplies); @@ -234,8 +234,8 @@ watch(enableAntennaTimeline, (x) => { reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); }); -watch(enableChannelTimeline, (x) => { - defaultStore.set('enableChannelTimeline', x); +watch(enableTagTimeline, (x) => { + defaultStore.set('enableTagTimeline', x); reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); }); @@ -525,9 +525,9 @@ const headerActions = computed(() => { ref: enableAntennaTimeline, }, { type: 'switch', - text: i18n.ts.channel, - icon: 'ti ti-device-tv', - ref: enableChannelTimeline, + text: i18n.ts.tags, + icon: 'ti ti-hash', + ref: enableTagTimeline, }); return displayOfTimelineChildMenu; From 0acc86ae19efb82366cb6d361efa3e0be3fea046 Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Thu, 26 Dec 2024 18:58:03 +0900 Subject: [PATCH 04/14] Fix(backend): OutboxFetch (#588) --- CHANGELOG_YOJO.md | 2 +- .../models/ApOutboxFetchService.ts | 34 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index c2450bbeb4..fb26fbe298 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -14,7 +14,7 @@ xxxx-xx-xx - Fix: MFMチートシートが表示できない不具合を修正 [#592](https://github.com/yojo-art/cherrypick/pull/592) ### Server -- +- Fix:`api/ap/fetch-outbox`でリノートしか取得されないのを修正 [#588](https://github.com/yojo-art/cherrypick/pull/588) ## 1.2.1 Cherrypick 4.13.0 diff --git a/packages/backend/src/core/activitypub/models/ApOutboxFetchService.ts b/packages/backend/src/core/activitypub/models/ApOutboxFetchService.ts index 8fc4dff1a7..e108da6011 100644 --- a/packages/backend/src/core/activitypub/models/ApOutboxFetchService.ts +++ b/packages/backend/src/core/activitypub/models/ApOutboxFetchService.ts @@ -66,7 +66,6 @@ export class ApOutboxFetchService implements OnModuleInit { this.apLoggerService = this.moduleRef.get('ApLoggerService'); this.logger = this.apLoggerService.logger; } - /** * outboxから投稿を取得します */ @@ -85,14 +84,19 @@ export class ApOutboxFetchService implements OnModuleInit { const cache = await this.redisClient.get(`${outboxUrl}--next`); let next: string | IOrderedCollectionPage; - if (!cache) { + if (cache) { + next = cache; + } else { // Resolve to (Ordered)Collection Object const outbox = await Resolver.resolveOrderedCollection(outboxUrl); if (!outbox.first) throw new IdentifiableError('a723c2df-0250-4091-b5fc-e3a7b36c7b61', 'outbox first page not exist'); next = outbox.first; - } else next = cache; + } - let created = 0; + let current = { + created: 0, + breaked: false, + }; for (let page = 0; page < pagelimit; page++) { const collection = (typeof(next) === 'string' ? await Resolver.resolveOrderedCollectionPage(next) : next); @@ -101,10 +105,13 @@ export class ApOutboxFetchService implements OnModuleInit { const activityes = (collection.orderedItems ?? collection.items); if (!activityes) throw new IdentifiableError('2a05bb06-f38c-4854-af6f-7fd5e87c98ee', 'item is unavailable'); - created = await this.fetchObjects(user, activityes, includeAnnounce, created); - if (createLimit <= created) break;//次ページ見て一件だけしか取れないのは微妙 - if (!collection.next) break; + do { + current = await this.fetchObjects(user, activityes, includeAnnounce, current.created); + page++; + } + while (!current.breaked && page < pagelimit); + if (!collection.next) break; next = collection.next; await this.redisClient.set(`${outboxUrl}--next`, `${next}`, 'EX', 60 * 15);//15min } @@ -112,9 +119,12 @@ export class ApOutboxFetchService implements OnModuleInit { } @bindThis - private async fetchObjects(user: MiRemoteUser, activityes: any[], includeAnnounce:boolean, created: number): Promise { + private async fetchObjects(user: MiRemoteUser, activityes: any[], includeAnnounce:boolean, created: number): Promise<{ + created: number; + breaked: boolean; + }> { for (const activity of activityes) { - if (createLimit < created) return created; + if (createLimit < created) return { created: created, breaked: true }; try { if (activity.actor !== user.uri) throw new IdentifiableError('bde7c204-5441-4a87-9b7e-f81e8d05788a'); if (activity.type === 'Announce' && includeAnnounce) { @@ -177,7 +187,7 @@ export class ApOutboxFetchService implements OnModuleInit { } } else if (isCreate(activity)) { if (typeof(activity.object) !== 'string') { - if (!isNote(activity)) continue; + if (!isNote(activity.object)) continue; } const fetch = await this.apNoteService.fetchNote(activity.object); if (fetch) continue; @@ -190,11 +200,11 @@ export class ApOutboxFetchService implements OnModuleInit { } else { this.logger.error(`fetchError:${activity.id}`); this.logger.error(`${err}`); - continue; } + continue; } created ++; } - return created; + return { created: created, breaked: false }; } } From 85f8bbc41d1e7e79d814a79f551c69180ef520d2 Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Thu, 26 Dec 2024 19:23:44 +0900 Subject: [PATCH 05/14] =?UTF-8?q?Fix:=20=E5=BC=95=E7=94=A8=E3=82=84?= =?UTF-8?q?=E8=BF=94=E4=BF=A1=E3=81=AE=E3=83=8E=E3=83=BC=E3=83=88=E3=81=99?= =?UTF-8?q?=E3=81=B9=E3=81=A6=E3=81=AB=E7=BF=BB=E8=A8=B3=E3=83=9C=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=20(#598)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 1 + .../src/components/MkSubNoteContent.vue | 30 ++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index fb26fbe298..e7c72c3923 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -12,6 +12,7 @@ xxxx-xx-xx - Fix: ノート詳細画面でリアクション出来ない [#584](https://github.com/yojo-art/cherrypick/pull/584) - Fix: タイムラインオプションで表示有無選択の選択肢を修正 [#590](https://github.com/yojo-art/cherrypick/pull/590) - Fix: MFMチートシートが表示できない不具合を修正 [#592](https://github.com/yojo-art/cherrypick/pull/592) +- Fix: 引用や返信のノートすべてに翻訳ボタンが表示される [#598](https://github.com/yojo-art/cherrypick/pull/598) ### Server - Fix:`api/ap/fetch-outbox`でリノートしか取得されないのを修正 [#588](https://github.com/yojo-art/cherrypick/pull/588) diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index 00ea4fd43a..4a0116accb 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only :enableAnimatedMfm="enableAnimatedMfm" /> RN: ... - + {{ i18n.ts.translateNote }} {{ i18n.ts.close }} @@ -29,7 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.tsx.translatedFrom({ x: translation.sourceLang }) }}: - { os.popupMenu(await getNoteClipMenu({ note: note.value, isDeleted, currentClip: currentClip?.value }), clipButton.value).then(focus); } -const isForeignLanguage: boolean = note.value.text != null && (() => { +const isForeignLanguage: boolean = (note.value.text != null || note.value.poll != null) && (() => { const targetLang = (miLocalStorage.getItem('lang') ?? navigator.language).slice(0, 2); - const postLang = detectLanguage(note.value.text); - const choicesLang = note.value.poll?.choices.map((choice) => choice.text).join(' ') ?? ''; - const pollLang = detectLanguage(choicesLang); - return postLang !== '' && (postLang !== targetLang || pollLang !== targetLang); + if (note.value.text) { + const postLang = detectLanguage(note.value.text); + if (postLang !== '' && postLang !== targetLang) return true; + } + if (note.value.poll) { + const foreignLang = note.value.poll.choices + .map((choice) => detectLanguage(choice.text)) + .filter((lang) => lang !== targetLang).length; + if (0 < foreignLang) return true; + } + return false; })(); if (defaultStore.state.useAutoTranslate && instance.translatorAvailable && $i.policies.canUseTranslator && $i.policies.canUseAutoTranslate && !isLong && (note.value.cw == null || showContent.value) && note.value.text && isForeignLanguage) translate(); @@ -474,6 +481,15 @@ async function translate(): Promise { collapsed.value = false; translating.value = true; + if (note.value.text == null) { + translating.value = false; + translation.value = { + sourceLang: '', + text: '', + }; + return; + } + vibrate(defaultStore.state.vibrateSystem ? 5 : []); if (props.mock) { From 5bce17b33e4426e1f65de7f91ef834b31bffcee6 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:40:35 +0900 Subject: [PATCH 06/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=A7Cherrypick=E3=81=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=83=85=E5=A0=B1=E8=A6=8B=E3=81=A6=E3=81=9F=E7=AE=87?= =?UTF-8?q?=E6=89=80=E3=82=92=E4=BF=AE=E6=AD=A3=20(#599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend-embed/src/boot.ts | 2 +- packages/frontend/src/boot/common.ts | 2 +- packages/frontend/src/pages/admin/index.vue | 8 ++++---- packages/frontend/src/ui/_common_/navbar-for-mobile.vue | 8 ++++---- packages/frontend/src/ui/_common_/navbar.vue | 8 ++++---- packages/frontend/src/ui/classic.header.vue | 8 ++++---- packages/frontend/src/ui/classic.sidebar.vue | 8 ++++---- packages/frontend/src/ui/friendly/navbar-for-mobile.vue | 8 ++++---- packages/frontend/src/ui/friendly/navbar.vue | 8 ++++---- packages/sw/src/scripts/create-notification.ts | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/frontend-embed/src/boot.ts b/packages/frontend-embed/src/boot.ts index 3421f43c3c..0c6ab28159 100644 --- a/packages/frontend-embed/src/boot.ts +++ b/packages/frontend-embed/src/boot.ts @@ -23,7 +23,7 @@ import { serverMetadata } from '@/server-metadata.js'; import { postMessageToParentWindow, setIframeId } from '@/post-message.js'; import { serverContext } from '@/server-context.js'; -console.log('CherryPick Embed'); +console.log('yojo-art Embed'); //#region Embedパラメータの取得・パース const params = new URLSearchParams(location.search); diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 432cb1080a..58ee3b77e5 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -27,7 +27,7 @@ import { createMainRouter } from '@/router/definition.js'; import { popup } from '@/os.js'; export async function common(createVue: () => App) { - console.info(`CherryPick v${version}`); + console.info(`yojo-art v${version}`); if (_DEV_) { console.warn('Development mode!!!'); diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue index ed88e10534..cf7415514f 100644 --- a/packages/frontend/src/pages/admin/index.vue +++ b/packages/frontend/src/pages/admin/index.vue @@ -70,7 +70,7 @@ const noInquiryUrl = computed(() => isEmpty(instance.inquiryUrl)); const thereIsUnresolvedAbuseReport = ref(false); const currentPage = computed(() => router.currentRef.value.child); const updateAvailable = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); misskeyApi('admin/abuse-user-reports', { state: 'unresolved', @@ -81,11 +81,11 @@ misskeyApi('admin/abuse-user-reports', { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { updateAvailable.value = true; } }); diff --git a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue index c2083be1ba..9a80a8a106 100644 --- a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue @@ -74,7 +74,7 @@ const otherMenuItemIndicated = computed(() => { return false; }); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -86,11 +86,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index b0a2349b5a..26220c4199 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -86,7 +86,7 @@ const otherMenuItemIndicated = computed(() => { return false; }); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -98,11 +98,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/frontend/src/ui/classic.header.vue b/packages/frontend/src/ui/classic.header.vue index 5dad914202..cc05d194b0 100644 --- a/packages/frontend/src/ui/classic.header.vue +++ b/packages/frontend/src/ui/classic.header.vue @@ -74,7 +74,7 @@ const otherNavItemIndicated = computed(() => { }); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -86,11 +86,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/frontend/src/ui/classic.sidebar.vue b/packages/frontend/src/ui/classic.sidebar.vue index 0f9f304816..9382f186d1 100644 --- a/packages/frontend/src/ui/classic.sidebar.vue +++ b/packages/frontend/src/ui/classic.sidebar.vue @@ -83,7 +83,7 @@ const el = shallowRef(); const iconOnly = ref(false); const settingsWindowed = ref(false); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -95,11 +95,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/frontend/src/ui/friendly/navbar-for-mobile.vue b/packages/frontend/src/ui/friendly/navbar-for-mobile.vue index 9abe38054e..ada3323ec8 100644 --- a/packages/frontend/src/ui/friendly/navbar-for-mobile.vue +++ b/packages/frontend/src/ui/friendly/navbar-for-mobile.vue @@ -76,7 +76,7 @@ const otherMenuItemIndicated = computed(() => { return false; }); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -88,11 +88,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/frontend/src/ui/friendly/navbar.vue b/packages/frontend/src/ui/friendly/navbar.vue index 53b0f91682..1d7ef12723 100644 --- a/packages/frontend/src/ui/friendly/navbar.vue +++ b/packages/frontend/src/ui/friendly/navbar.vue @@ -93,7 +93,7 @@ const otherMenuItemIndicated = computed(() => { return false; }); const controlPanelIndicated = ref(false); -const releasesCherryPick = ref(null); +const releasesYojoArt = ref(null); if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/abuse-user-reports', { @@ -105,11 +105,11 @@ if ($i.isAdmin ?? $i.isModerator) { misskeyApi('admin/meta') .then(meta => { - return fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases') + return fetch('https://api.github.com/repos/yojo-art/cherrypick/releases') .then(res => res.json()) .then(cherryPickData => { - releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); - if ((compareVersions(version, releasesCherryPick.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesCherryPick.value[0].tag_name) < 0)) { + releasesYojoArt.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease); + if ((compareVersions(version, releasesYojoArt.value[0].tag_name) < 0) && (compareVersions(meta.skipCherryPickVersion, releasesYojoArt.value[0].tag_name) < 0)) { controlPanelIndicated.value = true; } }); diff --git a/packages/sw/src/scripts/create-notification.ts b/packages/sw/src/scripts/create-notification.ts index b9300bb9de..aabb387dfa 100644 --- a/packages/sw/src/scripts/create-notification.ts +++ b/packages/sw/src/scripts/create-notification.ts @@ -323,7 +323,7 @@ export async function createEmptyNotification(): Promise { await globalThis.registration.showNotification( (new URL(origin)).host, { - body: `CherryPick v${_VERSION_}`, + body: `yojo-art v${_VERSION_}`, silent: true, badge: iconUrl('null'), tag: 'read_notification', From 84f0f475564243dc4fcd8278f637fc0ee9a4ff3b Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 00:08:25 +0900 Subject: [PATCH 07/14] Release: 1.2.2(Develop) (#601) --- CHANGELOG_YOJO.md | 2 +- package.json | 2 +- packages/cherrypick-js/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index e7c72c3923..c178b16b02 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -3,7 +3,7 @@ Cherrypick 4.13.0 Misskey 2024.10.1 ### Release Date -xxxx-xx-xx +2024-12-27 ### General - diff --git a/package.json b/package.json index ba05f139e1..3839989a4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yojo-art", - "version": "1.2.1", + "version": "1.2.2", "basedMisskeyVersion": "2024.10.1", "basedCherrypickVersion": "4.13.0", "codename": "nasubi", diff --git a/packages/cherrypick-js/package.json b/packages/cherrypick-js/package.json index 1d2ea63b1c..bd407f027b 100644 --- a/packages/cherrypick-js/package.json +++ b/packages/cherrypick-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "cherrypick-js", - "version": "1.2.1", + "version": "1.2.2", "basedMisskeyVersion": "2024.10.1", "basedCherrypickVersion": "4.13.0", "description": "yojo-art SDK for JavaScript", From 29bd16102f64e56930bc979356b7c62606ea17b0 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 01:48:43 +0900 Subject: [PATCH 08/14] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=81=AA=E3=82=89=E9=8D=B5=E3=83=8E=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=A7=E3=82=82=E3=82=A2=E3=83=B3=E3=83=86=E3=83=8A=E3=81=AB?= =?UTF-8?q?=E3=81=B2=E3=81=A3=E3=81=8B=E3=81=8B=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: mai <74494945+chan-mai@users.noreply.github.com> --- CHANGELOG_YOJO.md | 12 ++++++++++++ packages/backend/src/core/AntennaService.ts | 19 ++++++++++++++++--- packages/backend/test/e2e/antennas.ts | 19 ++++++++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index c178b16b02..5541202e98 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -1,3 +1,15 @@ +## 1.3.0 + +### Release Date + +### General + +### Client + +### Server +- Feat: フォローしているユーザーなら鍵ノートでもアンテナにひっかかるように [#568](https://github.com/yojo-art/cherrypick/pull/568) + - based-on https://github.com/team-shahu/misskey/pull/38 + ## 1.2.2 Cherrypick 4.13.0 Misskey 2024.10.1 diff --git a/packages/backend/src/core/AntennaService.ts b/packages/backend/src/core/AntennaService.ts index 3941a1c87d..5b9e828475 100644 --- a/packages/backend/src/core/AntennaService.ts +++ b/packages/backend/src/core/AntennaService.ts @@ -12,11 +12,12 @@ import { GlobalEventService } from '@/core/GlobalEventService.js'; import * as Acct from '@/misc/acct.js'; import type { Packed } from '@/misc/json-schema.js'; import { DI } from '@/di-symbols.js'; -import type { AntennasRepository, UserGroupJoiningsRepository, UserListMembershipsRepository } from '@/models/_.js'; +import type { AntennasRepository, UserGroupJoiningsRepository, UserListMembershipsRepository, FollowingsRepository } from '@/models/_.js'; import { UtilityService } from '@/core/UtilityService.js'; import { bindThis } from '@/decorators.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js'; import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; +import { CacheService } from '@/core/CacheService.js'; import { deserializeAntenna } from './deserializeAntenna.js'; import type { OnApplicationShutdown } from '@nestjs/common'; @@ -41,6 +42,10 @@ export class AntennaService implements OnApplicationShutdown { @Inject(DI.userListMembershipsRepository) private userListMembershipsRepository: UserListMembershipsRepository, + @Inject(DI.followingsRepository) + private followingsRepository: FollowingsRepository, + + private cacheService: CacheService, private utilityService: UtilityService, private globalEventService: GlobalEventService, private fanoutTimelineService: FanoutTimelineService, @@ -99,8 +104,16 @@ export class AntennaService implements OnApplicationShutdown { @bindThis public async checkHitAntenna(antenna: MiAntenna, note: (MiNote | Packed<'Note'>), noteUser: { id: MiUser['id']; username: string; host: string | null; isBot: boolean; }): Promise { - if (note.visibility === 'specified') return false; - if (note.visibility === 'followers') return false; + if (note.visibility === 'specified') { + if (note.userId !== antenna.userId) { + if (note.visibleUserIds == null) return false; + if (!note.visibleUserIds.includes(antenna.userId)) return false; + } + } + if (note.visibility === 'followers') { + const isFollowing = Object.hasOwn(await this.cacheService.userFollowingsCache.fetch(antenna.userId), note.userId); + if (!isFollowing && antenna.userId !== note.userId) return false; + } if (antenna.excludeBots && noteUser.isBot) return false; diff --git a/packages/backend/test/e2e/antennas.ts b/packages/backend/test/e2e/antennas.ts index c82b9498cb..210ee9a7a3 100644 --- a/packages/backend/test/e2e/antennas.ts +++ b/packages/backend/test/e2e/antennas.ts @@ -376,13 +376,26 @@ describe('アンテナ', () => { }, { // https://github.com/misskey-dev/misskey/issues/9025 - label: 'ただし、フォロワー限定投稿とDM投稿を含まない。フォロワーであっても。', + // https://github.com/yojo-art/cherrypick/pull/568 + label: 'フォロワー限定投稿とDM投稿を含む', parameters: () => ({}), posts: [ { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'public' }), included: true }, { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'home' }), included: true }, - { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }) }, - { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }) }, + { note: (): Promise => post(userFollowedByAlice, { text: `${keyword}`, visibility: 'followers' }), included: true }, + { note: (): Promise => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [alice.id] }), included: true }, + ], + }, + { + // https://github.com/misskey-dev/misskey/issues/9025 + // https://github.com/yojo-art/cherrypick/pull/568 + label: 'フォロワー限定投稿とDM投稿を含まない', + parameters: () => ({}), + posts: [ + { note: (): Promise => post(bob, { text: `${keyword}`, visibility: 'public' }), included: true }, + { note: (): Promise => post(bob, { text: `${keyword}`, visibility: 'home' }), included: true }, + { note: (): Promise => post(bob, { text: `${keyword}`, visibility: 'followers' }) }, + { note: (): Promise => post(bob, { text: `${keyword}`, visibility: 'specified', visibleUserIds: [carol.id] }) }, ], }, { From db1709a5869978a35a9a3c9ee94ccb13dc64c7f0 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 03:32:12 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E6=99=82=E3=81=AB=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E6=AC=84=E3=81=AB=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E5=85=83=E3=82=92=E8=BF=BD=E8=A8=98=E3=81=99=E3=82=8B?= =?UTF-8?q?=20(#573)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 2 ++ locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + packages/frontend/src/scripts/import-emoji.ts | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 5541202e98..d99e6647d8 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -3,8 +3,10 @@ ### Release Date ### General +- ### Client +- Enhance: インポート時にライセンス欄にインポート元を追記する [#573](https://github.com/yojo-art/cherrypick/pull/573) ### Server - Feat: フォローしているユーザーなら鍵ノートでもアンテナにひっかかるように [#568](https://github.com/yojo-art/cherrypick/pull/568) diff --git a/locales/index.d.ts b/locales/index.d.ts index 7eebd65a0d..1439931512 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1137,6 +1137,10 @@ export interface Locale extends ILocale { * カスタム絵文字 */ "customEmojis": string; + /** + * 詳細情報が利用できません + */ + "emojiRemoteDetailedUnavailable": string; /** * 絵文字 */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index cb27e3dfd4..1211a2b6d6 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -277,6 +277,7 @@ selectWidget: "ウィジェットを選択" editWidgets: "ウィジェットを編集" editWidgetsExit: "編集を終了" customEmojis: "カスタム絵文字" +emojiRemoteDetailedUnavailable: "詳細情報が利用できません" emoji: "絵文字" emojis: "絵文字" emojiName: "絵文字名" diff --git a/packages/frontend/src/scripts/import-emoji.ts b/packages/frontend/src/scripts/import-emoji.ts index 0417559f03..d74b9086ac 100644 --- a/packages/frontend/src/scripts/import-emoji.ts +++ b/packages/frontend/src/scripts/import-emoji.ts @@ -2,8 +2,9 @@ * SPDX-FileCopyrightText: syuilo and misskey-project, yojo-art team * SPDX-License-Identifier: AGPL-3.0-only */ +import { i18n } from '@/i18n.js'; export async function importEmojiMeta(emoji, host:string) { - emoji.category = '取得失敗'; + emoji.category = i18n.ts.emojiRemoteDetailedUnavailable; try { const json = await(await fetch('https://' + host + '/api/emoji?name=' + emoji.name)).json(); emoji.category = ''; @@ -24,5 +25,6 @@ export async function importEmojiMeta(emoji, host:string) { console.log(err); //リモートから取得に失敗 } + emoji.license = (emoji.license ? emoji.license + '\n' : '') + 'import from ' + host; return emoji; } From 595cd9484e5e7624d389644ff9b3de3aaa735f23 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 03:33:36 +0900 Subject: [PATCH 10/14] =?UTF-8?q?=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0?= =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AE=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E4=B8=80=E8=A6=A7=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(#595)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 2 +- .../backend/src/server/api/endpoints/admin/drive/files.ts | 4 +++- packages/cherrypick-js/src/autogen/types.ts | 2 +- packages/frontend/src/pages/admin/files.vue | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index d99e6647d8..c17dd7bf40 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -3,7 +3,7 @@ ### Release Date ### General -- +- Feat: システムユーザーのファイル一覧を追加 [#595](https://github.com/yojo-art/cherrypick/pull/595) ### Client - Enhance: インポート時にライセンス欄にインポート元を追記する [#573](https://github.com/yojo-art/cherrypick/pull/573) diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index 915d777e77..c37d968a0c 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -36,7 +36,7 @@ export const paramDef = { untilId: { type: 'string', format: 'misskey:id' }, userId: { type: 'string', format: 'misskey:id', nullable: true }, type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) }, - origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' }, + origin: { type: 'string', enum: ['combined', 'local', 'remote', 'system'], default: 'local' }, hostname: { type: 'string', nullable: true, @@ -66,6 +66,8 @@ export default class extends Endpoint { // eslint- query.andWhere('file.userHost IS NULL'); } else if (ps.origin === 'remote') { query.andWhere('file.userHost IS NOT NULL'); + } else if (ps.origin === 'system') { + query.andWhere('file.userId IS NULL'); } if (ps.hostname) { diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts index 5d94b88bb7..8a3dc7ab51 100644 --- a/packages/cherrypick-js/src/autogen/types.ts +++ b/packages/cherrypick-js/src/autogen/types.ts @@ -7550,7 +7550,7 @@ export type operations = { * @default local * @enum {string} */ - origin?: 'combined' | 'local' | 'remote'; + origin?: 'combined' | 'local' | 'remote' | 'system'; /** * @description The local host is represented with `null`. * @default null diff --git a/packages/frontend/src/pages/admin/files.vue b/packages/frontend/src/pages/admin/files.vue index 4cc859227f..00e3e5a370 100644 --- a/packages/frontend/src/pages/admin/files.vue +++ b/packages/frontend/src/pages/admin/files.vue @@ -15,6 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.all }} {{ i18n.ts.local }} {{ i18n.ts.remote }} + {{ i18n.ts.system }} {{ i18n.ts.host }} @@ -50,7 +51,7 @@ const origin = ref('local'); const type = ref(null); const searchHost = ref(''); const userId = ref(''); -const viewMode = ref('grid'); +const viewMode = ref<'grid'|'list'>('grid'); const pagination = { endpoint: 'admin/drive/files' as const, limit: 10, From 7ffca72fe032d074a01c337711b4b06a44c0626b Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 03:54:57 +0900 Subject: [PATCH 11/14] =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E8=A9=B3?= =?UTF-8?q?=E7=B4=B0=E3=81=8B=E3=82=89=E5=89=8D=E5=BE=8C=E3=81=AEHTL/LTL?= =?UTF-8?q?=E3=82=92=E9=96=8B=E3=81=8F=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(#572)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 1 + packages/frontend/src/pages/note.vue | 148 +++++++++++++++++++-------- 2 files changed, 104 insertions(+), 45 deletions(-) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index c17dd7bf40..35f49233ee 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -6,6 +6,7 @@ - Feat: システムユーザーのファイル一覧を追加 [#595](https://github.com/yojo-art/cherrypick/pull/595) ### Client +- Enhance: ノート詳細から前後のHTL/LTLを開く機能を追加 [#572](https://github.com/yojo-art/cherrypick/pull/572) - Enhance: インポート時にライセンス欄にインポート元を追記する [#573](https://github.com/yojo-art/cherrypick/pull/573) ### Server diff --git a/packages/frontend/src/pages/note.vue b/packages/frontend/src/pages/note.vue index 9b685c3250..10e07add8a 100644 --- a/packages/frontend/src/pages/note.vue +++ b/packages/frontend/src/pages/note.vue @@ -11,13 +11,15 @@ SPDX-License-Identifier: AGPL-3.0-only - + - - + + + + @@ -30,13 +32,15 @@ SPDX-License-Identifier: AGPL-3.0-only - - + + + + - + @@ -61,6 +65,7 @@ import { i18n } from '@/i18n.js'; import { dateString } from '@/filters/date.js'; import MkClipPreview from '@/components/MkClipPreview.vue'; import { defaultStore } from '@/store.js'; +import { isAvailableBasicTimeline } from '@/timelines.js'; const props = defineProps<{ noteId: string; @@ -69,47 +74,100 @@ const props = defineProps<{ const note = ref(); const clips = ref(); -const showPrev = ref<'user' | 'channel' | false>(false); -const showNext = ref<'user' | 'channel' | false>(false); +type TimelineType = 'user' | 'home' | 'local' | 'channel' | false; +const showPrev = ref(false); +const showNext = ref(false); const error = ref(); -const prevUserPagination: Paging = { - endpoint: 'users/notes', - limit: 10, - params: computed(() => note.value ? ({ - userId: note.value.userId, - untilId: note.value.id, - }) : undefined), -}; - -const nextUserPagination: Paging = { - reversed: true, - endpoint: 'users/notes', - limit: 10, - params: computed(() => note.value ? ({ - userId: note.value.userId, - sinceId: note.value.id, - }) : undefined), -}; - -const prevChannelPagination: Paging = { - endpoint: 'channels/timeline', - limit: 10, - params: computed(() => note.value ? ({ - channelId: note.value.channelId, - untilId: note.value.id, - }) : undefined), -}; - -const nextChannelPagination: Paging = { - reversed: true, - endpoint: 'channels/timeline', - limit: 10, - params: computed(() => note.value ? ({ - channelId: note.value.channelId, - sinceId: note.value.id, - }) : undefined), -}; +function showPrevPagination(tl:TimelineType): Paging { + switch (tl) { + case 'channel': + return { + endpoint: 'channels/timeline', + limit: 10, + params: computed(() => note.value ? ({ + channelId: note.value.channelId, + untilId: note.value.id, + }) : undefined), + }; + case 'home': + return { + endpoint: 'notes/timeline', + limit: 10, + params: computed(() => note.value ? ({ + withRenotes: true, + withReplies: true, + untilId: note.value.id, + }) : undefined), + }; + case 'local': + return { + endpoint: 'notes/local-timeline', + limit: 10, + params: computed(() => note.value ? ({ + withRenotes: true, + withReplies: true, + untilId: note.value.id, + }) : undefined), + }; + default: + return { + endpoint: 'users/notes', + limit: 10, + params: computed(() => note.value ? ({ + userId: note.value.userId, + untilId: note.value.id, + }) : undefined), + }; + } +} + +function showNextPagination(tl:TimelineType):Paging { + switch (tl) { + case 'channel': + return { + reversed: true, + endpoint: 'channels/timeline', + limit: 10, + params: computed(() => note.value ? ({ + channelId: note.value.channelId, + sinceId: note.value.id, + }) : undefined), + }; + case 'home': + return { + reversed: true, + endpoint: 'notes/timeline', + limit: 10, + params: computed(() => note.value ? ({ + withRenotes: true, + withReplies: true, + sinceId: note.value.id, + }) : undefined), + }; + case 'local': + return { + reversed: true, + endpoint: 'notes/local-timeline', + limit: 10, + params: computed(() => note.value ? ({ + withRenotes: true, + withReplies: true, + sinceId: note.value.id, + }) : undefined), + }; + default: + return { + reversed: true, + endpoint: 'users/notes', + limit: 10, + params: computed(() => note.value ? ({ + userId: note.value.userId, + sinceId: note.value.id, + }) : undefined), + }; + } +} function fetchNote() { showPrev.value = false; From 1658048af3a6ad0d08e1959edc8c2e5710305a9e Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 18:45:03 +0900 Subject: [PATCH 12/14] =?UTF-8?q?MFM=E3=81=AE=E6=A4=9C=E7=B4=A2=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=82=B8=E3=83=B3=E3=82=92=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E8=A8=AD=E5=AE=9A=E3=81=A7=E5=A4=89=E3=81=88=E3=82=8B?= =?UTF-8?q?=20(#575)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 ++++ locales/ja-JP.yml | 1 + packages/frontend/src/components/MkGoogle.vue | 15 ++++++++++++--- packages/frontend/src/pages/settings/general.vue | 6 ++++++ .../src/pages/settings/preferences-backups.vue | 4 ++++ packages/frontend/src/store.ts | 4 ++++ 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 1439931512..4b7e0705cf 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4215,6 +4215,10 @@ export interface Locale extends ILocale { * CWを維持する */ "keepCw": string; + /** + * %sが検索語句に置き換えられます + */ + "searchEngineDescription": string; /** * Pub/Subのアカウント */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1211a2b6d6..e955f6a450 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1045,6 +1045,7 @@ usernameInfo: "サーバー上であなたのアカウントを一意に識別 aiChanMode: "藍モード" devMode: "開発者モード" keepCw: "CWを維持する" +searchEngineDescription: "%sが検索語句に置き換えられます" pubSub: "Pub/Subのアカウント" lastCommunication: "直近の通信" resolved: "解決済み" diff --git a/packages/frontend/src/components/MkGoogle.vue b/packages/frontend/src/components/MkGoogle.vue index da7bcde4d8..21bc007c37 100644 --- a/packages/frontend/src/components/MkGoogle.vue +++ b/packages/frontend/src/components/MkGoogle.vue @@ -12,7 +12,12 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 293c912004..417d054353 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -60,6 +60,10 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.noNyaization }} CherryPick {{ i18n.ts.showMultipleRenoteWarning }} yojo-art + + {{ i18n.ts.search }}yojo-art + {{ i18n.ts.searchEngineDescription }} + {{ i18n.ts.whenServerDisconnected }} CherryPick {{ i18n.ts._serverDisconnectedBehavior.reload }} @@ -161,6 +165,7 @@ import FormSection from '@/components/form/section.vue'; import FormLink from '@/components/form/link.vue'; import MkLink from '@/components/MkLink.vue'; import MkInfo from '@/components/MkInfo.vue'; +import MkInput from '@/components/MkInput.vue'; import { defaultStore } from '@/store.js'; import * as os from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; @@ -201,6 +206,7 @@ const useAutoTranslate = computed(defaultStore.makeGetterSetter('useAutoTranslat const welcomeBackToast = computed(defaultStore.makeGetterSetter('welcomeBackToast')); const disableNyaize = computed(defaultStore.makeGetterSetter('disableNyaize')); const checkMultipleRenote = computed(defaultStore.makeGetterSetter('checkMultipleRenote')); +const searchEngine = computed(defaultStore.makeGetterSetter('searchEngine')); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); diff --git a/packages/frontend/src/pages/settings/preferences-backups.vue b/packages/frontend/src/pages/settings/preferences-backups.vue index 7e53f2a3a7..ce0be8da04 100644 --- a/packages/frontend/src/pages/settings/preferences-backups.vue +++ b/packages/frontend/src/pages/settings/preferences-backups.vue @@ -191,6 +191,10 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [ 'showMoreButtonInNoteFooter', 'selectReaction', // #endregion CherryPick + // #region yojo-art + 'checkMultipleRenote', + 'searchEngine', + // #endregion yojo-art ]; const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [ 'lightTheme', diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index f2b3d35c94..9e486c4072 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -153,6 +153,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'account', default: [] as string[], }, + searchEngine: { + where: 'account', + default: 'https://www.google.com/search?q=%s', + }, menu: { where: 'deviceAccount', From c3e0bc730c66cc49ed0a823c12da8d3d592efa26 Mon Sep 17 00:00:00 2001 From: kozakura913 <98575220+kozakura913@users.noreply.github.com> Date: Fri, 27 Dec 2024 18:48:24 +0900 Subject: [PATCH 13/14] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=83=8D?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AB=E7=B5=B5?= =?UTF-8?q?=E6=96=87=E5=AD=97=E3=81=A8=E3=81=97=E3=81=A6=E5=88=A9=E7=94=A8?= =?UTF-8?q?=E4=B8=AD=E3=83=A9=E3=83=99=E3=83=AB=E3=82=92=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=20(#603)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_YOJO.md | 1 + .../src/components/MkFileListForAdmin.vue | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/CHANGELOG_YOJO.md b/CHANGELOG_YOJO.md index 35f49233ee..33739701ba 100644 --- a/CHANGELOG_YOJO.md +++ b/CHANGELOG_YOJO.md @@ -8,6 +8,7 @@ ### Client - Enhance: ノート詳細から前後のHTL/LTLを開く機能を追加 [#572](https://github.com/yojo-art/cherrypick/pull/572) - Enhance: インポート時にライセンス欄にインポート元を追記する [#573](https://github.com/yojo-art/cherrypick/pull/573) +- Feat: コンパネのファイルに絵文字として利用中ラベルを表示する [#603](https://github.com/yojo-art/cherrypick/pull/603) ### Server - Feat: フォローしているユーザーなら鍵ノートでもアンテナにひっかかるように [#568](https://github.com/yojo-art/cherrypick/pull/568) diff --git a/packages/frontend/src/components/MkFileListForAdmin.vue b/packages/frontend/src/components/MkFileListForAdmin.vue index 5f9db49cae..8cba1af129 100644 --- a/packages/frontend/src/components/MkFileListForAdmin.vue +++ b/packages/frontend/src/components/MkFileListForAdmin.vue @@ -14,6 +14,10 @@ SPDX-License-Identifier: AGPL-3.0-only class="file _button" > {{ i18n.ts.sensitive }} + + + {{ i18n.ts.emoji }} + @@ -38,12 +42,18 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._mfc.mentionDescription }}
{{ i18n.ts._mfc.hashtagDescription }}
{{ i18n.ts._mfc.urlDescription }}
{{ i18n.ts._mfc.linkDescription }}
{{ i18n.ts._mfc.emojiDescription }}
{{ i18n.ts._mfc.boldDescription }}
{{ i18n.ts._mfc.smallDescription }}
{{ i18n.ts._mfc.quoteDescription }}
{{ i18n.ts._mfc.centerDescription }}
{{ i18n.ts._mfc.inlineCodeDescription }}
{{ i18n.ts._mfc.blockCodeDescription }}
{{ i18n.ts._mfc.inlineMathDescription }}
{{ i18n.ts._mfc.blockMathDescription }}
{{ i18n.ts._mfc.searchDescription }}
{{ i18n.ts._mfc.flipDescription }}
{{ i18n.ts._mfc.fontDescription }}
{{ i18n.ts._mfc.x2Description }}
{{ i18n.ts._mfc.x3Description }}
{{ i18n.ts._mfc.x4Description }}
{{ i18n.ts._mfc.blurDescription }}
{{ i18n.ts._mfc.jellyDescription }}
{{ i18n.ts._mfc.tadaDescription }}
{{ i18n.ts._mfc.jumpDescription }}
{{ i18n.ts._mfc.bounceDescription }}
{{ i18n.ts._mfc.spinDescription }}
{{ i18n.ts._mfc.shakeDescription }}
{{ i18n.ts._mfc.twitchDescription }}
{{ i18n.ts._mfc.rainbowDescription }}
{{ i18n.ts._mfc.sparkleDescription }}
{{ i18n.ts._mfc.fadeDescription }}
{{ i18n.ts._mfc.rotateDescription }}
{{ i18n.ts._mfc.positionDescription }}
{{ i18n.ts._mfc.scaleDescription }}
{{ i18n.ts._mfc.fgDescription }}
{{ i18n.ts._mfc.bgDescription }}
{{ i18n.ts._mfc.plainDescription }}
{{ i18n.ts._mfc.rubyDescription }}
{{ i18n.ts._mfm.borderDescription }}
{{ i18n.ts._mfc.borderDescription }}
{{ i18n.ts.emoji }}