add: source endpoint for editing through masto api

This commit is contained in:
Mar0xy 2023-09-27 14:45:57 +02:00
parent e32b03a048
commit a12d1c52dd
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
5 changed files with 37 additions and 5 deletions

View file

@ -305,6 +305,14 @@ namespace MisskeyAPI {
}
}
export const notesource = (n: Entity.Note): MegalodonEntity.StatusSource => {
return {
id: n.id,
text: n.text ?? '',
spoiler_text: n.cw ? n.cw : ''
}
}
const mapEmojis = (e: Array<Entity.Emoji> | { [key: string]: string }): Array<MegalodonEntity.Emoji> => {
if (Array.isArray(e)) {
return e.map(e => emoji(e))