fedimbed: autospoiler if sensitive
This commit is contained in:
parent
beeee91e2e
commit
0936ce6937
1 changed files with 7 additions and 0 deletions
|
@ -293,6 +293,10 @@ async function processUrl(msg, url, spoiler = false) {
|
|||
avatar: postData2.account?.avatar ?? postData2.user?.avatarUrl,
|
||||
};
|
||||
timestamp = postData2.created_at ?? postData2.createdAt;
|
||||
if (!spoiler && postData2.sensitive) {
|
||||
spoiler = true;
|
||||
}
|
||||
|
||||
const attachments = postData2.media_attachments ?? postData2.files;
|
||||
if (attachments) {
|
||||
for (const attachment of attachments) {
|
||||
|
@ -349,6 +353,9 @@ async function processUrl(msg, url, spoiler = false) {
|
|||
postData._misskey_content ?? postData.source?.content ?? postData.content;
|
||||
cw = postData.summary;
|
||||
timestamp = postData.published;
|
||||
if (!spoiler && postData.sensitive) {
|
||||
spoiler = true;
|
||||
}
|
||||
|
||||
// NB: gts doesnt send singular attachments as areay
|
||||
const attachments = Array.isArray(postData.attachment)
|
||||
|
|
Loading…
Reference in a new issue