Mastodonのリンクの所有者認証に対応 (#5161)

* Profile metadata を設定できるように

* API desc
This commit is contained in:
MeiMei 2019-07-18 00:11:39 +09:00 committed by syuilo
parent f1a7ab639b
commit ef44eda69e
8 changed files with 92 additions and 4 deletions

View file

@ -77,6 +77,13 @@ export const meta = {
}
},
fields: {
validator: $.optional.arr($.object()).range(1, 4),
desc: {
'ja-JP': 'プロフィール補足情報'
}
},
isLocked: {
validator: $.optional.bool,
desc: {
@ -226,6 +233,14 @@ export default define(meta, async (ps, user, app) => {
profileUpdates.pinnedPageId = null;
}
if (ps.fields) {
profileUpdates.fields = ps.fields
.filter(x => typeof x.name === 'string' && x.name !== '' && typeof x.value === 'string' && x.value !== '')
.map(x => {
return { name: x.name, value: x.value };
});
}
//#region emojis/tags
let emojis = [] as string[];