summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-01-03 13:35:40 +0900
committerGitHub <noreply@github.com>2024-01-03 13:35:40 +0900
commita9127e3ecd0c5789ba01123b8c4bbfc22c4e70e3 (patch)
tree63864ff145adaaaff5288c17654ad9d61db6b7b2 /packages
parentenhance(frontend): カスタム絵文字追加画面の「タグ」の説明... (diff)
downloadmisskey-a9127e3ecd0c5789ba01123b8c4bbfc22c4e70e3.tar.gz
misskey-a9127e3ecd0c5789ba01123b8c4bbfc22c4e70e3.tar.bz2
misskey-a9127e3ecd0c5789ba01123b8c4bbfc22c4e70e3.zip
enhance(frontend): チャンネルノートのピン留めをノートメニューからできるように (#12887)
* enhance(frontend): チャンネルノートのピン留めをノートメニューからできるように * Update Changelog
Diffstat (limited to 'packages')
-rw-r--r--packages/backend/src/core/entities/NoteEntityService.ts1
-rw-r--r--packages/backend/src/models/json-schema/note.ts4
-rw-r--r--packages/frontend/src/scripts/get-note-menu.ts36
-rw-r--r--packages/misskey-js/src/autogen/apiClientJSDoc.ts5
-rw-r--r--packages/misskey-js/src/autogen/endpoint.ts4
-rw-r--r--packages/misskey-js/src/autogen/entities.ts4
-rw-r--r--packages/misskey-js/src/autogen/models.ts4
-rw-r--r--packages/misskey-js/src/autogen/types.ts17
8 files changed, 60 insertions, 15 deletions
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts
index c49dad8e79..1777e2cf54 100644
--- a/packages/backend/src/core/entities/NoteEntityService.ts
+++ b/packages/backend/src/core/entities/NoteEntityService.ts
@@ -351,6 +351,7 @@ export class NoteEntityService implements OnModuleInit {
color: channel.color,
isSensitive: channel.isSensitive,
allowRenoteToExternal: channel.allowRenoteToExternal,
+ userId: channel.userId,
} : undefined,
mentions: note.mentions.length > 0 ? note.mentions : undefined,
uri: note.uri ?? undefined,
diff --git a/packages/backend/src/models/json-schema/note.ts b/packages/backend/src/models/json-schema/note.ts
index aa749943f0..2b7722129b 100644
--- a/packages/backend/src/models/json-schema/note.ts
+++ b/packages/backend/src/models/json-schema/note.ts
@@ -148,6 +148,10 @@ export const packedNoteSchema = {
type: 'boolean',
optional: false, nullable: false,
},
+ userId: {
+ type: 'string',
+ optional: false, nullable: true,
+ },
},
},
localOnly: {
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts
index 7130e69279..b9224c5595 100644
--- a/packages/frontend/src/scripts/get-note-menu.ts
+++ b/packages/frontend/src/scripts/get-note-menu.ts
@@ -352,6 +352,42 @@ export function getNoteMenu(props: {
]
: []
),
+ ...(appearNote.channel && (appearNote.channel.userId === $i.id || $i.isModerator || $i.isAdmin) ? [
+ { type: 'divider' },
+ {
+ type: 'parent' as const,
+ icon: 'ti ti-device-tv',
+ text: i18n.ts.channel,
+ children: async () => {
+ const channelChildMenu = [] as MenuItem[];
+
+ const channel = await os.api('channels/show', { channelId: appearNote.channel!.id });
+
+ if (channel.pinnedNoteIds.includes(appearNote.id)) {
+ channelChildMenu.push({
+ icon: 'ti ti-pinned-off',
+ text: i18n.ts.unpin,
+ action: () => os.apiWithDialog('channels/update', {
+ channelId: appearNote.channel!.id,
+ pinnedNoteIds: channel.pinnedNoteIds.filter(id => id !== appearNote.id),
+ }),
+ });
+ } else {
+ channelChildMenu.push({
+ icon: 'ti ti-pin',
+ text: i18n.ts.pin,
+ action: () => os.apiWithDialog('channels/update', {
+ channelId: appearNote.channel!.id,
+ pinnedNoteIds: [...channel.pinnedNoteIds, appearNote.id],
+ }),
+ });
+ }
+ return channelChildMenu;
+ },
+ },
+ ]
+ : []
+ ),
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
{ type: 'divider' },
appearNote.userId === $i.id ? {
diff --git a/packages/misskey-js/src/autogen/apiClientJSDoc.ts b/packages/misskey-js/src/autogen/apiClientJSDoc.ts
index 758beaf3a0..e8722cab3b 100644
--- a/packages/misskey-js/src/autogen/apiClientJSDoc.ts
+++ b/packages/misskey-js/src/autogen/apiClientJSDoc.ts
@@ -1,6 +1,6 @@
/*
- * version: 2023.12.0
- * generatedAt: 2023-12-26T23:35:09.494Z
+ * version: 2023.12.2
+ * generatedAt: 2024-01-02T08:53:57.449Z
*/
import type { SwitchCaseResponseType } from '../api.js';
@@ -33,7 +33,6 @@ declare module '../api.js' {
/**
* No description provided.
*
- * **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
* **Credential required**: *No*
*/
request<E extends 'admin/accounts/create', P extends Endpoints[E]['req']>(
diff --git a/packages/misskey-js/src/autogen/endpoint.ts b/packages/misskey-js/src/autogen/endpoint.ts
index 2ed76a22f9..192a1a31e0 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
- * generatedAt: 2023-12-26T23:35:09.491Z
+ * version: 2023.12.2
+ * generatedAt: 2024-01-02T08:53:57.445Z
*/
import type {
diff --git a/packages/misskey-js/src/autogen/entities.ts b/packages/misskey-js/src/autogen/entities.ts
index c857e8e370..fd4d7372cc 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
- * generatedAt: 2023-12-26T23:35:09.489Z
+ * version: 2023.12.2
+ * generatedAt: 2024-01-02T08:53:57.443Z
*/
import { operations } from './types.js';
diff --git a/packages/misskey-js/src/autogen/models.ts b/packages/misskey-js/src/autogen/models.ts
index c5b81a6b41..db0ada0f3b 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
- * generatedAt: 2023-12-26T23:35:09.485Z
+ * version: 2023.12.2
+ * generatedAt: 2024-01-02T08:53:57.441Z
*/
import { components } from './types.js';
diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts
index 94bb263980..37c8f58f58 100644
--- a/packages/misskey-js/src/autogen/types.ts
+++ b/packages/misskey-js/src/autogen/types.ts
@@ -2,8 +2,8 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */
/*
- * version: 2023.12.0
- * generatedAt: 2023-12-26T23:35:09.389Z
+ * version: 2023.12.2
+ * generatedAt: 2024-01-02T08:53:56.447Z
*/
/**
@@ -40,7 +40,6 @@ export type paths = {
* admin/accounts/create
* @description No description provided.
*
- * **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
* **Credential required**: *No*
*/
post: operations['admin/accounts/create'];
@@ -3788,13 +3787,14 @@ export type components = {
* @example xxxxxxxxxx
*/
channelId?: string | null;
- channel?: {
+ channel?: ({
id: string;
name: string;
color: string;
isSensitive: boolean;
allowRenoteToExternal: boolean;
- } | null;
+ userId: string | null;
+ }) | null;
localOnly?: boolean;
reactionAcceptance: string | null;
reactions: Record<string, never>;
@@ -4456,6 +4456,9 @@ export type operations = {
enableActiveEmailValidation: boolean;
enableVerifymailApi: boolean;
verifymailAuthKey: string | null;
+ enableTruemailApi: boolean;
+ truemailInstance: string | null;
+ truemailAuthKey: string | null;
enableChartsForRemoteUser: boolean;
enableChartsForFederatedInstances: boolean;
enableServerMachineStats: boolean;
@@ -4620,7 +4623,6 @@ export type operations = {
* admin/accounts/create
* @description No description provided.
*
- * **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
* **Credential required**: *No*
*/
'admin/accounts/create': {
@@ -8247,6 +8249,9 @@ export type operations = {
enableActiveEmailValidation?: boolean;
enableVerifymailApi?: boolean;
verifymailAuthKey?: string | null;
+ enableTruemailApi?: boolean;
+ truemailInstance?: string | null;
+ truemailAuthKey?: string | null;
enableChartsForRemoteUser?: boolean;
enableChartsForFederatedInstances?: boolean;
enableServerMachineStats?: boolean;