remove duplicate attach.sensitive updates
This commit is contained in:
parent
e3cf30ad09
commit
5e46efe60d
1 changed files with 4 additions and 5 deletions
|
|
@ -719,7 +719,6 @@ export class ApNoteService {
|
||||||
if (htmlContent) {
|
if (htmlContent) {
|
||||||
for (const attach of extractMediaFromHtml(htmlContent)) {
|
for (const attach of extractMediaFromHtml(htmlContent)) {
|
||||||
if (hasUrl(attach)) {
|
if (hasUrl(attach)) {
|
||||||
attach.sensitive ??= note.sensitive;
|
|
||||||
attachments.set(attach.url, attach);
|
attachments.set(attach.url, attach);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -744,7 +743,6 @@ export class ApNoteService {
|
||||||
const icon = getBestIcon(note);
|
const icon = getBestIcon(note);
|
||||||
if (icon) {
|
if (icon) {
|
||||||
if (hasUrl(icon)) {
|
if (hasUrl(icon)) {
|
||||||
icon.sensitive ??= note.sensitive;
|
|
||||||
attachments.set(icon.url, icon);
|
attachments.set(icon.url, icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -753,7 +751,6 @@ export class ApNoteService {
|
||||||
// AP attachments should be considered canonical.
|
// AP attachments should be considered canonical.
|
||||||
for (const attach of toArray(note.attachment)) {
|
for (const attach of toArray(note.attachment)) {
|
||||||
if (hasUrl(attach)) {
|
if (hasUrl(attach)) {
|
||||||
attach.sensitive ??= note.sensitive;
|
|
||||||
attachments.set(attach.url, attach);
|
attachments.set(attach.url, attach);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -764,8 +761,10 @@ export class ApNoteService {
|
||||||
const results = await Promise
|
const results = await Promise
|
||||||
.all(Array
|
.all(Array
|
||||||
.from(attachments.values())
|
.from(attachments.values())
|
||||||
.map(attach => limiter(() => this
|
.map(attach => limiter(async () => {
|
||||||
.resolveImage(actor, attach))));
|
attach.sensitive ??= note.sensitive;
|
||||||
|
return await this.resolveImage(actor, attach);
|
||||||
|
})));
|
||||||
|
|
||||||
// Process results
|
// Process results
|
||||||
let hasFileError = false;
|
let hasFileError = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue