fix more variable issues in processContent
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/lint-backend Pipeline failed Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/test Pipeline failed Details

This commit is contained in:
Johann150 2023-05-30 20:58:18 +02:00
parent 7c9e118ff1
commit 7272bde464
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ export function validateNote(object: IObject): Error | null {
/**
* Function to process the content of a note, reusable in createNote and updateNote.
*/
async function processContent(actor: IRemoteUser, note: IPost, quoteUri: string | null):
async function processContent(actor: IRemoteUser, note: IPost, quoteUri: string | null, resolver: Resolver):
Promise<{
cw: string | null,
files: DriveFile[],
@ -78,10 +78,10 @@ async function processContent(actor: IRemoteUser, note: IPost, quoteUri: string
const limit = promiseLimit(2);
const attachments = toArray(note.attachment);
const files = note.attachment
const files = attachments
// If the note is marked as sensitive, the images should be marked sensitive too.
.map(attach => attach.sensitive |= note.sensitive)
? (await Promise.all(note.attachment.map(x => limit(() => resolveImage(actor, x, resolver)) as Promise<DriveFile>)))
? (await Promise.all(attachments.map(x => limit(() => resolveImage(actor, x, resolver)) as Promise<DriveFile>)))
.filter(image => image != null)
: [];
@ -258,7 +258,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
const poll = await extractPollFromQuestion(note, resolver).catch(() => undefined);
const processedContent = await processContent(actor, note, quote?.uri);
const processedContent = await processContent(actor, note, quote?.uri, resolver);
if (isTalk) {
for (const recipient of visibleUsers) {