From 33034b0e02860513d277e8f8a08f96a84592b3e3 Mon Sep 17 00:00:00 2001 From: yupix Date: Mon, 4 Dec 2023 16:53:31 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=82=AD=E3=83=BC=E3=83=9E=E3=81=AE=E6=94=B9?= =?UTF-8?q?=E5=96=84=20(#12568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: notifyにenumを設定 * feat: securityKeysListの型を明確に * feat: notificationRecieveConfigにpropertiesを定義 * chore: misskey.jsのmodelを更新 * fix: as constをつけ忘れている --- .../backend/src/models/json-schema/user.ts | 43 +++++++++++++ packages/misskey-js/src/autogen/endpoint.ts | 2 +- packages/misskey-js/src/autogen/entities.ts | 2 +- packages/misskey-js/src/autogen/models.ts | 2 +- packages/misskey-js/src/autogen/types.ts | 63 +++++++++++++++++-- 5 files changed, 105 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index a2ec203e96..2621e7e6c0 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -3,6 +3,18 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +const notificationRecieveConfig = { + type: 'object', + nullable: false, optional: true, + properties: { + type: { + type: 'string', + nullable: false, optional: false, + enum: ['all', 'following', 'follower', 'mutualFollow', 'list', 'never'], + }, + }, +} as const; + export const packedUserLiteSchema = { type: 'object', properties: { @@ -398,6 +410,7 @@ export const packedUserDetailedNotMeOnlySchema = { notify: { type: 'string', nullable: false, optional: true, + enum: ['normal', 'none'], }, withReplies: { type: 'boolean', @@ -553,6 +566,19 @@ export const packedMeDetailedOnlySchema = { notificationRecieveConfig: { type: 'object', nullable: false, optional: false, + properties: { + app: notificationRecieveConfig, + quote: notificationRecieveConfig, + reply: notificationRecieveConfig, + follow: notificationRecieveConfig, + renote: notificationRecieveConfig, + mention: notificationRecieveConfig, + reaction: notificationRecieveConfig, + pollEnded: notificationRecieveConfig, + achievementEarned: notificationRecieveConfig, + receiveFollowRequest: notificationRecieveConfig, + followRequestAccepted: notificationRecieveConfig, + }, }, emailNotificationTypes: { type: 'array', @@ -697,6 +723,23 @@ export const packedMeDetailedOnlySchema = { items: { type: 'object', nullable: false, optional: false, + properties: { + id: { + type: 'string', + nullable: false, optional: false, + format: 'id', + example: 'xxxxxxxxxx', + }, + name: { + type: 'string', + nullable: false, optional: false, + }, + lastUsed: { + type: 'string', + nullable: false, optional: false, + format: 'date-time', + }, + }, }, }, //#endregion diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts index b46e69f691..cf571fc689 100644 --- a/packages/misskey-js/src/autogen/endpoint.ts +++ b/packages/misskey-js/src/autogen/endpoint.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.058Z + * generatedAt: 2023-12-04T07:13:58.541Z */ import type { diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts index a51ee037d0..bbfa14913f 100644 --- a/packages/misskey-js/src/autogen/entities.ts +++ b/packages/misskey-js/src/autogen/entities.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.053Z + * generatedAt: 2023-12-04T07:13:58.538Z */ import { operations } from './types.js'; diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts index c2b27b2c58..566b6dfb97 100644 --- a/packages/misskey-js/src/autogen/models.ts +++ b/packages/misskey-js/src/autogen/models.ts @@ -1,6 +1,6 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:45.051Z + * generatedAt: 2023-12-04T07:13:58.535Z */ import { components } from './types.js'; diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 44ed4dbaa8..b734b36e49 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -3,7 +3,7 @@ /* * version: 2023.12.0-beta.1 - * generatedAt: 2023-12-03T02:04:44.864Z + * generatedAt: 2023-12-04T07:13:58.362Z */ /** @@ -3218,7 +3218,8 @@ export type components = { isBlocked?: boolean; isMuted?: boolean; isRenoteMuted?: boolean; - notify?: string; + /** @enum {string} */ + notify?: 'normal' | 'none'; withReplies?: boolean; }; MeDetailedOnly: { @@ -3253,7 +3254,52 @@ export type components = { mutedWords: string[][]; hardMutedWords: string[][]; mutedInstances: string[] | null; - notificationRecieveConfig: Record; + notificationRecieveConfig: { + app?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + quote?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + reply?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + follow?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + renote?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + mention?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + reaction?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + pollEnded?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + achievementEarned?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + receiveFollowRequest?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + followRequestAccepted?: { + /** @enum {string} */ + type: 'all' | 'following' | 'follower' | 'mutualFollow' | 'list' | 'never'; + }; + }; emailNotificationTypes: string[]; achievements: { name: string; @@ -3287,7 +3333,16 @@ export type components = { }; email?: string | null; emailVerified?: boolean | null; - securityKeysList?: Record[]; + securityKeysList?: { + /** + * Format: id + * @example xxxxxxxxxx + */ + id: string; + name: string; + /** Format: date-time */ + lastUsed: string; + }[]; }; UserDetailedNotMe: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly']; MeDetailed: components['schemas']['UserLite'] & components['schemas']['UserDetailedNotMeOnly'] & components['schemas']['MeDetailedOnly']; From bb38e62ae696873990d0252c66200c361878e9f8 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 4 Dec 2023 17:56:48 +0900 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20=E8=87=AA=E5=88=86=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=97=E3=83=A9=E3=82=A4=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E8=B5=B0=E6=9F=BB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=20(#12570)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/FanoutTimelineService.ts | 1 + packages/backend/src/core/NoteCreateService.ts | 3 +++ .../src/server/api/endpoints/notes/local-timeline.ts | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/FanoutTimelineService.ts b/packages/backend/src/core/FanoutTimelineService.ts index 654a035a5f..9b2678fbcd 100644 --- a/packages/backend/src/core/FanoutTimelineService.ts +++ b/packages/backend/src/core/FanoutTimelineService.ts @@ -17,6 +17,7 @@ export type FanoutTimelineName = | `localTimeline` // replies are not included | `localTimelineWithFiles` // only non-reply notes with files are included | `localTimelineWithReplies` // only replies are included + | `localTimelineWithReplyTo:${string}` // Only replies to specific local user are included. Parameter is reply user id. // antenna | `antennaTimeline:${string}` diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 0110ebaf5e..45dfbb87aa 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -933,6 +933,9 @@ export class NoteCreateService implements OnApplicationShutdown { if (note.visibility === 'public' && note.userHost == null) { this.fanoutTimelineService.push('localTimelineWithReplies', note.id, 300, r); + if (note.replyUserHost == null) { + this.fanoutTimelineService.push(`localTimelineWithReplyTo:${note.replyUserId}`, note.id, 300 / 10, r); + } } } else { this.fanoutTimelineService.push(`userTimeline:${user.id}`, note.id, note.userHost == null ? meta.perLocalUserUserTimelineCacheMax : meta.perRemoteUserUserTimelineCacheMax, r); diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index e8ba39bbf0..3fd4dc83fb 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -42,7 +42,7 @@ export const meta = { bothWithRepliesAndWithFiles: { message: 'Specifying both withReplies and withFiles is not supported', code: 'BOTH_WITH_REPLIES_AND_WITH_FILES', - id: 'dd9c8400-1cb5-4eef-8a31-200c5f933793' + id: 'dd9c8400-1cb5-4eef-8a31-200c5f933793', }, }, } as const; @@ -116,9 +116,12 @@ export default class extends Endpoint { // eslint- allowPartial: ps.allowPartial, me, useDbFallback: serverSettings.enableFanoutTimelineDbFallback, - redisTimelines: ps.withFiles ? ['localTimelineWithFiles'] : ['localTimeline', 'localTimelineWithReplies'], + redisTimelines: + ps.withFiles ? ['localTimelineWithFiles'] + : ps.withReplies ? ['localTimeline', 'localTimelineWithReplies'] + : me ? ['localTimeline', `localTimelineWithReplyTo:${me.id}`] + : ['localTimeline'], alwaysIncludeMyNotes: true, - excludeReplies: !ps.withReplies, excludePureRenotes: !ps.withRenotes, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({ untilId, From e90ad095516bfd6c363596c9262f4269359d48c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:12:14 +0900 Subject: [PATCH 3/6] =?UTF-8?q?fix=20(frontend):=20=E7=B5=B5=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=83=94=E3=83=83=E3=82=AB=E3=83=BC=E7=B5=8C=E7=94=B1?= =?UTF-8?q?=E3=81=A7=E6=8A=95=E7=A8=BF=E6=AC=84=E3=81=AB=E7=B5=B5=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=85=A5=E3=82=8C=E3=81=9F=E9=9A=9B=E3=80=81?= =?UTF-8?q?=E3=82=BD=E3=83=95=E3=83=88=E3=82=A6=E3=82=A7=E3=82=A2=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=83=9C=E3=83=BC=E3=83=89=E3=81=8C=E7=AB=8B=E3=81=A1?= =?UTF-8?q?=E4=B8=8A=E3=81=8C=E3=82=89=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=20(#12561)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/components/MkPostForm.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 0445536ae5..13b615d104 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.notSpecifiedMentionWarning }} -
-