公開範囲設定

This commit is contained in:
Xeltica 2020-07-24 22:43:39 +09:00
parent 92e8472b26
commit f02516b372
2 changed files with 10 additions and 2 deletions

View File

@ -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<string, string>;
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;
}

View File

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