diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index dcac32e3e..5500c3a37 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -900,11 +900,13 @@ _theme: funcKind: "Type de fonction" argument: "Argument" alpha: "Transparence" - darken: "Assombrir" + darken: "Sombre" + lighten: "Clair" inputConstantName: "Insérez un nom de constante" importInfo: "Vous pouvez importer un thème vers l’éditeur de thèmes en saisissant son code ici." deleteConstantConfirm: "Êtes-vous sûr·e de vouloir supprimer la constante {const} ?" keys: + accent: "Accentuation" bg: "Arrière-plan" fg: "Texte" focus: "Mise au point" @@ -940,6 +942,8 @@ _theme: driveFolderBg: "Arrière-plan du dossier de disque" badge: "Badge" messageBg: "Arrière plan de la discussion" + accentDarken: "Plus sombre" + accentLighten: "Plus clair" fgHighlighted: "Texte mis en évidence" _sfx: note: "Nouvelle note" @@ -1155,12 +1159,12 @@ _instanceCharts: usersTotal: "Nombre d'utilisateur·rice·s au total cumulé" notes: "Variation du nombre des notes" notesTotal: "Nombre total cumulé des notes" - ff: "Variation des abonné·e·s" - ffTotal: "Nombre d'abonné·e·s au total cumulé" + ff: "Variation des abonné·e·s et des abonnements" + ffTotal: "Total cumulé du nombre d'abonné·e·s et du nombre d'abonnements" cacheSize: "Variation de la taille du cache" - cacheSizeTotal: "La taille du cache au total cumulé" + cacheSizeTotal: "Total cumulé de la taille du cache" files: "Variation du nombre de fichiers" - filesTotal: "Nombre de fichiers au total cumulé" + filesTotal: "Total cumulé du nombre de fichiers" _timelines: home: "Principal" local: "Local" @@ -1237,7 +1241,7 @@ _pages: deleted: "La page a été supprimée" pageSetting: "Paramètres de la Page" nameAlreadyExists: "L'URL de page spécifiée existe déjà" - invalidNameTitle: "La URL de la page spécifiée n’est pas valide" + invalidNameTitle: "L'URL de page spécifiée n’est pas valide" invalidNameText: "Assurez-vous qu’il n’est pas vide" editThisPage: "Éditer cette page" viewSource: "Afficher la source" @@ -1259,14 +1263,14 @@ _pages: font: "Police de caractères" fontSerif: "Serif" fontSansSerif: "Sans Serif" - eyeCatchingImageSet: "Définir une image attirante" - eyeCatchingImageRemove: "Supprimer une image attirante" + eyeCatchingImageSet: "Définir une image attractive" + eyeCatchingImageRemove: "Supprimer l'image attractive" chooseBlock: "Ajouter un bloc" selectType: "Choisir un type" enterVariableName: "Veuillez entrer un nom pour votre variable" - variableNameIsAlreadyUsed: "Cette variable est déjà utilisée" + variableNameIsAlreadyUsed: "Ce nom de variable est déjà utilisé" contentBlocks: "Contenu" - inputBlocks: "Entrée" + inputBlocks: "Blocs d'entrée" specialBlocks: "Spécial" blocks: text: "Texte" diff --git a/locales/it-IT.yml b/locales/it-IT.yml index b96f3c99a..cc1178426 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -571,6 +571,7 @@ useGlobalSetting: "Usa impostazioni generali" useGlobalSettingDesc: "Se abilitato, le impostazioni notifiche dell'account verranno utilizzate. Se disabilitato, si possono definire diverse singole impostazioni." other: "Avanzate" fileIdOrUrl: "ID o URL del file" +chatOpenBehavior: "Comportamento della finestra di chat quando viene aperta" behavior: "Comportamento" abuseReports: "Segnala" reportAbuse: "Segnala" @@ -652,8 +653,10 @@ youAreRunningUpToDateClient: "Stai usando la versione più recente del client." newVersionOfClientAvailable: "Una nuova versione del tuo client è disponibile." usageAmount: "In utilizzo" capacity: "Capacità" +inUse: "In utilizzo" editCode: "Modifica codice" apply: "Applica" +receiveAnnouncementFromInstance: "Ricevi i messaggi informativi dall'istanza" emailNotification: "Eventi per notifiche via mail" publish: "Pubblico" inChannelSearch: "Cerca in canale" @@ -932,6 +935,7 @@ _widgets: photos: "Foto" digitalClock: "Orologio digitale" federation: "Federazione" + postForm: "Finestra di pubblicazione" button: "Pulsante" onlineUsers: "Utenti online" jobQueue: "Coda di lavoro" @@ -1005,6 +1009,9 @@ _instanceCharts: users: "Variazione del numero di utenti" usersTotal: "Totale cumulativo di utenti" notes: "Variazione del numero di note" + notesTotal: "Totale cumulato di note" + files: "Variazione del numero di file" + filesTotal: "Totale cumulato del numero di file" _timelines: home: "Home" local: "Locale" @@ -1012,8 +1019,16 @@ _timelines: global: "Federata" _rooms: roomOf: "Camera di {user}" + addFurniture: "Disponi mobilia" + translate: "Sposta" + rotate: "Ruota" + exit: "Indietro" remove: "Togli" + clear: "Rimuovi tutto" + clearConfirm: "Sei sicur@ di voler rimuovere tutti i mobili dalla tua camera?" leaveConfirm: "Hai fatto modifiche ancora non salvate. Vuoi davvero uscire?" + chooseImage: "Seleziona immagine" + roomType: "Tipo di stanza" _roomType: default: "Predefinito" washitsu: "Washitsu" @@ -1050,6 +1065,7 @@ _rooms: cube: "Cubo" tv: "Televisore" pinguin: "Pinguino" + rubik-cube: "Cubo di Rubik" bin: "Cestino" cup-noodle: "Noodle istantanei" _pages: @@ -1060,6 +1076,8 @@ _pages: updated: "Pagina aggiornata con successo!" deleted: "Pagina eliminata" pageSetting: "Impostazioni pagina" + nameAlreadyExists: "Esiste già una pagina con lo stesso URL." + invalidNameTitle: "L'URL di pagina definito non è valido" editThisPage: "Modifica questa pagina" viewSource: "Visualizza sorgente" viewPage: "Visualizza pagina" @@ -1072,11 +1090,21 @@ _pages: content: "Blocco di pagina" variables: "Variabili" title: "Titolo" + url: "URL della pagina" + summary: "Riassunto di pagina" hideTitleWhenPinned: "Nascondere il titolo pagina quando è fissata in cima al profilo." font: "Tipo di carattere" fontSerif: "Serif" fontSansSerif: "Sans serif" + eyeCatchingImageSet: "Imposta un'immagine attrattiva" + eyeCatchingImageRemove: "Elimina l'immagine attrattiva" chooseBlock: "Aggiungi blocco" + selectType: "Seleziona tipo" + enterVariableName: "Digita un nome di variabile" + variableNameIsAlreadyUsed: "Esiste già una variabile con lo stesso nome" + contentBlocks: "Contenuto" + inputBlocks: "Blocchi di input" + specialBlocks: "Speciale" blocks: text: "Testo" textarea: "Area di testo" @@ -1086,16 +1114,20 @@ _pages: if: "Se" _if: variable: "Variabili" + post: "Finestra di pubblicazione" _post: text: "Contenuto" + textInput: "Immissione testo" _textInput: name: "Nome della variabile" text: "Titolo" default: "Valore predefinito" + textareaInput: "Immissione testo a più righe" _textareaInput: name: "Nome della variabile" text: "Titolo" default: "Valore predefinito" + numberInput: "Immissione numerica" _numberInput: name: "Nome della variabile" text: "Titolo" @@ -1108,24 +1140,35 @@ _pages: id: "ID nota" idDescription: "Qui puoi anche incollare l'URL della nota che vuoi impostare." detailed: "Visualizzazione dettagliata" + switch: "Interruttore" _switch: name: "Nome della variabile" text: "Titolo" default: "Valore predefinito" + counter: "Contatore" _counter: name: "Nome della variabile" text: "Titolo" + inc: "Valore da aggiungere" _button: text: "Titolo" + colored: "Colorato" + action: "Operazione da eseguire quando viene premuto il pulsante" _action: + dialog: "Visualizzare una finestra di dialogo" _dialog: content: "Contenuto" + resetRandom: "Ripristinare un numero aleatorio" pushEvent: "Inviare evento" _pushEvent: event: "Nome evento" message: "Messaggio da visualizzare quando abilitato" variable: "Variabile da inviare" no-variable: "Nessun contenuto" + callAiScript: "Chiamare AiScript" + _callAiScript: + functionName: "Nome della funzione" + radioButton: "Opzioni" _radioButton: name: "Nome della variabile" title: "Titolo" @@ -1139,6 +1182,8 @@ _pages: list: "Liste" blocks: text: "Testo" + multiLineText: "Testo (a più righe)" + textList: "Lista di testo" _strLen: arg1: "Testo" _strPick: @@ -1193,13 +1238,18 @@ _pages: arg2: "B" _if: arg1: "Se" + arg2: "Se" random: "Aleatorietà" _randomPick: arg1: "Liste" _dailyRandomPick: arg1: "Liste" + _seedRandom: + arg2: "Probabilità" _seedRandomPick: arg2: "Liste" + _DRPWPM: + arg1: "Lista di testo" _pick: arg1: "Liste" _listLen: @@ -1213,6 +1263,7 @@ _pages: types: string: "Testo" array: "Liste" + stringArray: "Lista di testo" _notification: fileUploaded: "File caricato correttamente" youGotMention: "{name} ti ha menzionato" diff --git a/package.json b/package.json index 561c4d08b..0469a3648 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "12.79.1", + "version": "12.79.2", "codename": "indigo", "repository": { "type": "git", diff --git a/src/client/components/captcha.vue b/src/client/components/captcha.vue index 26215df09..5da8ede3b 100644 --- a/src/client/components/captcha.vue +++ b/src/client/components/captcha.vue @@ -6,7 +6,7 @@ + + diff --git a/src/client/pages/gallery/new.vue b/src/client/pages/gallery/new.vue deleted file mode 100644 index 3f9756df8..000000000 --- a/src/client/pages/gallery/new.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/src/client/pages/gallery/post.vue b/src/client/pages/gallery/post.vue index 9bd102cee..703506a78 100644 --- a/src/client/pages/gallery/post.vue +++ b/src/client/pages/gallery/post.vue @@ -19,6 +19,7 @@ {{ post.likedCount }}
+
@@ -84,6 +85,11 @@ export default defineComponent({ title: this.post.title, text: this.post.description, }, + actions: [{ + icon: 'fas fa-pencil-alt', + text: this.$ts.edit, + handler: this.edit + }] } : null), otherPostsPagination: { endpoint: 'users/gallery/posts', @@ -154,6 +160,10 @@ export default defineComponent({ this.post.likedCount--; }); }, + + edit() { + this.$router.push(`/gallery/${this.post.id}/edit`); + } } }); diff --git a/src/client/pages/mentions.vue b/src/client/pages/mentions.vue index a12993ebb..798d3e342 100644 --- a/src/client/pages/mentions.vue +++ b/src/client/pages/mentions.vue @@ -25,7 +25,6 @@ export default defineComponent({ endpoint: 'notes/mentions', limit: 10, }, - faAt }; }, diff --git a/src/client/pages/user/index.vue b/src/client/pages/user/index.vue index a1fe7ec09..717ca5d8f 100644 --- a/src/client/pages/user/index.vue +++ b/src/client/pages/user/index.vue @@ -161,15 +161,15 @@
- + {{ number(user.notesCount) }} {{ $ts.notes }} - + {{ number(user.followingCount) }} {{ $ts.following }} - + {{ number(user.followersCount) }} {{ $ts.followers }} diff --git a/src/client/router.ts b/src/client/router.ts index 5371bf17d..8dcc1d1eb 100644 --- a/src/client/router.ts +++ b/src/client/router.ts @@ -38,7 +38,8 @@ export const router = createRouter({ { path: '/pages/new', component: page('page-editor/page-editor') }, { path: '/pages/edit/:pageId', component: page('page-editor/page-editor'), props: route => ({ initPageId: route.params.pageId }) }, { path: '/gallery', component: page('gallery/index') }, - { path: '/gallery/new', component: page('gallery/new') }, + { path: '/gallery/new', component: page('gallery/edit') }, + { path: '/gallery/:postId/edit', component: page('gallery/edit'), props: route => ({ postId: route.params.postId }) }, { path: '/gallery/:postId', component: page('gallery/post'), props: route => ({ postId: route.params.postId }) }, { path: '/channels', component: page('channels') }, { path: '/channels/new', component: page('channel-editor') }, diff --git a/src/client/scripts/theme.ts b/src/client/scripts/theme.ts index b0bf620a7..09441c8a7 100644 --- a/src/client/scripts/theme.ts +++ b/src/client/scripts/theme.ts @@ -18,9 +18,11 @@ export const builtinThemes = [ require('@client/themes/l-light.json5'), require('@client/themes/l-apricot.json5'), require('@client/themes/l-rainy.json5'), + require('@client/themes/l-vivid.json5'), require('@client/themes/d-dark.json5'), require('@client/themes/d-persimmon.json5'), + require('@client/themes/d-astro.json5'), require('@client/themes/d-black.json5'), ] as Theme[]; diff --git a/src/client/themes/d-astro.json5 b/src/client/themes/d-astro.json5 new file mode 100644 index 000000000..a88e949c3 --- /dev/null +++ b/src/client/themes/d-astro.json5 @@ -0,0 +1,76 @@ +{ + id: '080a01c5-377d-4fbb-88cc-6bb5d04977ea', + base: 'dark', + name: 'Mi Astro', + author: 'syuilo', + props: { + bg: '#232125', + fg: '#efdab9', + cwBg: '#687390', + cwFg: '#393f4f', + link: '#78b0a0', + warn: '#ecb637', + badge: '#31b1ce', + error: '#ec4137', + focus: ':alpha<0.3<@accent', + navBg: '@panel', + navFg: '@fg', + panel: '#2a272b', + accent: '#81c08b', + header: ':alpha<0.7<@bg', + infoBg: '#253142', + infoFg: '#fff', + renote: '#659CC8', + shadow: 'rgba(0, 0, 0, 0.3)', + divider: 'rgba(255, 255, 255, 0.1)', + hashtag: '#ff9156', + mention: '#ffd152', + modalBg: 'rgba(0, 0, 0, 0.5)', + success: '#86b300', + buttonBg: 'rgba(255, 255, 255, 0.05)', + acrylicBg: ':alpha<0.5<@bg', + cwHoverBg: '#707b97', + indicator: '@accent', + mentionMe: '#fb5d38', + messageBg: ':lighten<5<@bg', + navActive: '@accent', + infoWarnBg: '#42321c', + infoWarnFg: '#ffbd3e', + navHoverFg: ':lighten<17<@fg', + dateLabelFg: '@fg', + inputBorder: '#959da2', + panelBorder: 'rgba(0, 0, 0, 0)', + panelShadow: '" 0 8px 24px rgba(0, 0, 0, 0.12)', + accentDarken: ':darken<10<@accent', + acrylicPanel: ':alpha<0.5<@panel', + navIndicator: '@accent', + accentLighten: ':lighten<10<@accent', + buttonHoverBg: 'rgba(255, 255, 255, 0.1)', + driveFolderBg: ':alpha<0.3<@accent', + fgHighlighted: ':lighten<3<@fg', + panelHeaderBg: ':lighten<3<@panel', + panelHeaderFg: '@fg', + htmlThemeColor: '@bg', + panelHighlight: ':lighten<3<@panel', + listItemHoverBg: 'rgba(255, 255, 255, 0.03)', + scrollbarHandle: 'rgba(255, 255, 255, 0.2)', + wallpaperOverlay: 'rgba(0, 0, 0, 0.5)', + panelHeaderDivider: 'rgba(0, 0, 0, 0)', + scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)', + X2: ':darken<2<@panel', + X3: 'rgba(255, 255, 255, 0.05)', + X4: 'rgba(255, 255, 255, 0.1)', + X5: 'rgba(255, 255, 255, 0.05)', + X6: 'rgba(255, 255, 255, 0.15)', + X7: 'rgba(255, 255, 255, 0.05)', + X8: ':lighten<5<@accent', + X9: ':darken<5<@accent', + X10: ':alpha<0.4<@accent', + X11: 'rgba(0, 0, 0, 0.3)', + X12: 'rgba(255, 255, 255, 0.1)', + X13: 'rgba(255, 255, 255, 0.15)', + X14: ':alpha<0.5<@navBg', + X15: ':alpha<0<@panel', + X16: ':alpha<0.7<@panel', + }, +} diff --git a/src/client/themes/l-light.json5 b/src/client/themes/l-light.json5 index fdc1700b9..27a973c88 100644 --- a/src/client/themes/l-light.json5 +++ b/src/client/themes/l-light.json5 @@ -10,7 +10,7 @@ props: { bg: '#f9f9f9', fg: '#676767', - divider: 'rgb(223, 223, 223)', + divider: '#e8e8e8', header: ':alpha<0.7<@panel', navBg: '#fff', panel: '#fff', diff --git a/src/client/themes/l-vivid.json5 b/src/client/themes/l-vivid.json5 new file mode 100644 index 000000000..a21e053b0 --- /dev/null +++ b/src/client/themes/l-vivid.json5 @@ -0,0 +1,82 @@ +{ + id: '6128c2a9-5c54-43fe-a47d-17942356470b', + + name: 'Mi Vivid', + author: 'syuilo', + + base: 'light', + + props: { + bg: '#fafafa', + fg: '#444', + cwBg: '#b1b9c1', + cwFg: '#fff', + link: '#ff9400', + warn: '#ecb637', + badge: '#31b1ce', + error: '#ec4137', + focus: ':alpha<0.3<@accent', + navBg: '@panel', + navFg: '@fg', + panel: '#fff', + accent: '#008cff', + header: ':alpha<0.7<@panel', + infoBg: '#e5f5ff', + infoFg: '#72818a', + renote: '@accent', + shadow: 'rgba(0, 0, 0, 0.1)', + divider: 'rgba(0, 0, 0, 0.08)', + hashtag: '#92d400', + mention: '@accent', + modalBg: 'rgba(0, 0, 0, 0.3)', + success: '#86b300', + buttonBg: 'rgba(0, 0, 0, 0.05)', + acrylicBg: ':alpha<0.5<@bg', + cwHoverBg: '#bbc4ce', + indicator: '@accent', + mentionMe: '@mention', + messageBg: '@panel', + navActive: '@accent', + infoWarnBg: '#fff0db', + infoWarnFg: '#573c08', + navHoverFg: ':darken<17<@fg', + dateLabelFg: '@fg', + inputBorder: '#dae0e4', + panelBorder: 'rgba(0, 0, 0, 0)', + panelShadow: '" 0 8px 24px rgb(21 43 75 / 8%)', + accentDarken: ':darken<10<@accent', + acrylicPanel: ':alpha<0.5<@panel', + navIndicator: '@accent', + accentLighten: ':lighten<10<@accent', + buttonHoverBg: 'rgba(0, 0, 0, 0.1)', + driveFolderBg: ':alpha<0.3<@accent', + fgHighlighted: ':darken<3<@fg', + fgTransparent: ':alpha<0.5<@fg', + panelHeaderBg: ':lighten<3<@panel', + panelHeaderFg: '@fg', + htmlThemeColor: '@bg', + panelHighlight: ':darken<3<@panel', + listItemHoverBg: 'rgba(0, 0, 0, 0.03)', + scrollbarHandle: 'rgba(0, 0, 0, 0.2)', + wallpaperOverlay: 'rgba(255, 255, 255, 0.5)', + fgTransparentWeak: ':alpha<0.75<@fg', + panelHeaderDivider: '@divider', + scrollbarHandleHover: 'rgba(0, 0, 0, 0.4)', + X2: ':darken<2<@panel', + X3: 'rgba(0, 0, 0, 0.05)', + X4: 'rgba(0, 0, 0, 0.1)', + X5: 'rgba(0, 0, 0, 0.05)', + X6: 'rgba(0, 0, 0, 0.25)', + X7: 'rgba(0, 0, 0, 0.05)', + X8: ':lighten<5<@accent', + X9: ':darken<5<@accent', + X10: ':alpha<0.4<@accent', + X11: 'rgba(0, 0, 0, 0.1)', + X12: 'rgba(0, 0, 0, 0.1)', + X13: 'rgba(0, 0, 0, 0.15)', + X14: ':alpha<0.5<@navBg', + X15: ':alpha<0<@panel', + X16: ':alpha<0.7<@panel', + X17: ':alpha<0.8<@bg', + }, +} diff --git a/src/client/ui/deck/mentions-column.vue b/src/client/ui/deck/mentions-column.vue index 053ef918f..c625bb3ea 100644 --- a/src/client/ui/deck/mentions-column.vue +++ b/src/client/ui/deck/mentions-column.vue @@ -36,7 +36,6 @@ export default defineComponent({ endpoint: 'notes/mentions', limit: 10, }, - faAt } }, diff --git a/src/docs/it-IT/reversi-bot.md b/src/docs/it-IT/reversi-bot.md index 7ab2a7212..00d4a18a8 100644 --- a/src/docs/it-IT/reversi-bot.md +++ b/src/docs/it-IT/reversi-bot.md @@ -110,7 +110,7 @@ y = Math.floor(pos / mapWidth) ``` ### フォームコントロールの種類 -#### スイッチ +#### Interruttore type: `switch` スイッチを表示します。何かの機能をオン/オフさせたい場合に有用です。 ##### プロパティ diff --git a/src/server/api/endpoints/gallery/posts/delete.ts b/src/server/api/endpoints/gallery/posts/delete.ts new file mode 100644 index 000000000..8b54828b2 --- /dev/null +++ b/src/server/api/endpoints/gallery/posts/delete.ts @@ -0,0 +1,40 @@ +import $ from 'cafy'; +import define from '../../../define'; +import { ApiError } from '../../../error'; +import { GalleryPosts } from '../../../../../models'; +import { ID } from '@/misc/cafy-id'; + +export const meta = { + tags: ['gallery'], + + requireCredential: true as const, + + kind: 'write:gallery', + + params: { + postId: { + validator: $.type(ID), + }, + }, + + errors: { + noSuchPost: { + message: 'No such post.', + code: 'NO_SUCH_POST', + id: 'ae52f367-4bd7-4ecd-afc6-5672fff427f5' + }, + } +}; + +export default define(meta, async (ps, user) => { + const post = await GalleryPosts.findOne({ + id: ps.postId, + userId: user.id, + }); + + if (post == null) { + throw new ApiError(meta.errors.noSuchPost); + } + + await GalleryPosts.delete(post.id); +}); diff --git a/src/server/api/endpoints/gallery/posts/update.ts b/src/server/api/endpoints/gallery/posts/update.ts new file mode 100644 index 000000000..c8bb8d48c --- /dev/null +++ b/src/server/api/endpoints/gallery/posts/update.ts @@ -0,0 +1,81 @@ +import $ from 'cafy'; +import * as ms from 'ms'; +import define from '../../../define'; +import { ID } from '../../../../../misc/cafy-id'; +import { DriveFiles, GalleryPosts } from '../../../../../models'; +import { GalleryPost } from '../../../../../models/entities/gallery-post'; +import { ApiError } from '../../../error'; + +export const meta = { + tags: ['gallery'], + + requireCredential: true as const, + + kind: 'write:gallery', + + limit: { + duration: ms('1hour'), + max: 300 + }, + + params: { + postId: { + validator: $.type(ID), + }, + + title: { + validator: $.str.min(1), + }, + + description: { + validator: $.optional.nullable.str, + }, + + fileIds: { + validator: $.arr($.type(ID)).unique().range(1, 32), + }, + + isSensitive: { + validator: $.optional.bool, + default: false, + }, + }, + + res: { + type: 'object' as const, + optional: false as const, nullable: false as const, + ref: 'GalleryPost', + }, + + errors: { + + } +}; + +export default define(meta, async (ps, user) => { + const files = (await Promise.all(ps.fileIds.map(fileId => + DriveFiles.findOne({ + id: fileId, + userId: user.id + }) + ))).filter(file => file != null); + + if (files.length === 0) { + throw new Error(); + } + + await GalleryPosts.update({ + id: ps.postId, + userId: user.id, + }, { + updatedAt: new Date(), + title: ps.title, + description: ps.description, + isSensitive: ps.isSensitive, + fileIds: files.map(file => file.id) + }); + + const post = await GalleryPosts.findOneOrFail(ps.postId); + + return await GalleryPosts.pack(post, user); +}); diff --git a/src/server/web/index.ts b/src/server/web/index.ts index c3b184088..cc343063a 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -252,7 +252,7 @@ router.get('/users/:user', async ctx => { }); // Note -router.get('/notes/:note', async ctx => { +router.get('/notes/:note', async (ctx, next) => { const note = await Notes.findOne(ctx.params.note); if (note) { @@ -277,11 +277,11 @@ router.get('/notes/:note', async ctx => { return; } - ctx.status = 404; + await next(); }); // Page -router.get('/@:user/pages/:page', async ctx => { +router.get('/@:user/pages/:page', async (ctx, next) => { const { username, host } = parseAcct(ctx.params.user); const user = await Users.findOne({ usernameLower: username.toLowerCase(), @@ -314,12 +314,12 @@ router.get('/@:user/pages/:page', async ctx => { return; } - ctx.status = 404; + await next(); }); // Clip // TODO: 非publicなclipのハンドリング -router.get('/clips/:clip', async ctx => { +router.get('/clips/:clip', async (ctx, next) => { const clip = await Clips.findOne({ id: ctx.params.clip, }); @@ -339,11 +339,11 @@ router.get('/clips/:clip', async ctx => { return; } - ctx.status = 404; + await next(); }); // Gallery post -router.get('/gallery/:post', async ctx => { +router.get('/gallery/:post', async (ctx, next) => { const post = await GalleryPosts.findOne(ctx.params.post); if (post) { @@ -362,11 +362,11 @@ router.get('/gallery/:post', async ctx => { return; } - ctx.status = 404; + await next(); }); // Channel -router.get('/channels/:channel', async ctx => { +router.get('/channels/:channel', async (ctx, next) => { const channel = await Channels.findOne({ id: ctx.params.channel, }); @@ -384,7 +384,7 @@ router.get('/channels/:channel', async ctx => { return; } - ctx.status = 404; + await next(); }); //#endregion