From f02516b3726470be403d1d16183d0e3fb8f31b20 Mon Sep 17 00:00:00 2001 From: Xeltica Date: Fri, 24 Jul 2020 22:43:39 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E9=96=8B=E7=AF=84=E5=9B=B2=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router.ts | 3 ++- src/views/_components.pug | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/router.ts b/src/router.ts index d21a8cd..68a4d98 100644 --- a/src/router.ts +++ b/src/router.ts @@ -228,12 +228,13 @@ router.post('/action/:action', async ctx => { try { switch (action) { case 'create-note': { - const { text, renoteId, replyId, useCw, cw } = ctx.request.body; + const { text, renoteId, replyId, useCw, cw, visibility } = ctx.request.body; const opts = { i } as Record; if (text) opts.text = text; if (renoteId) opts.renoteId = renoteId; if (replyId) opts.replyId = replyId; if (useCw) opts.cw = cw || ''; + if (visibility) opts.visibility = visibility; await api(host, 'notes/create', opts); break; } diff --git a/src/views/_components.pug b/src/views/_components.pug index 7be7aee..27f984a 100644 --- a/src/views/_components.pug +++ b/src/views/_components.pug @@ -14,7 +14,7 @@ mixin note-header(note) if note.user.isBot span.bot [BOT] if note.user.isCat - span.bot [CAT] + span.bot [CAT] mixin sub-note(note) .sub-note @@ -84,6 +84,13 @@ mixin post-form(url, placeholder, buttonText) span CW input(type="text", name="cw" placeholder="注釈(省略可能)" style="max-width: 100%; min-width: 100%;") textarea(name="text", placeholder=placeholder style="max-width: 100%; min-width: 100%; height: 6em; margin-bottom: 8px") + + div: label 公開範囲: + select(name="visibility") + option(value="public") パブリック + option(value="home") ホーム + option(value="followers") フォロワー + option(value="direct") ダイレクト button(type="submit")= buttonText block