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 - @@ -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 + @@ -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 + + + + @@ -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