fixup: server: parse quote tag syntax
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This is a fixup for commit 5893a44ff5
.
This commit is contained in:
parent
f207d839c4
commit
17c9a9374d
1 changed files with 6 additions and 4 deletions
|
@ -185,6 +185,7 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
|
||||||
};
|
};
|
||||||
|
|
||||||
const uris = unique([quoteUrl, note._misskey_quote, note.quoteUri].filter((x): x is string => typeof x === 'string'));
|
const uris = unique([quoteUrl, note._misskey_quote, note.quoteUri].filter((x): x is string => typeof x === 'string'));
|
||||||
|
let temperror = false;
|
||||||
// check the urls sequentially and abort early to not do unnecessary HTTP requests
|
// check the urls sequentially and abort early to not do unnecessary HTTP requests
|
||||||
// picks the first one that works
|
// picks the first one that works
|
||||||
for (const uri in uris) {
|
for (const uri in uris) {
|
||||||
|
@ -192,14 +193,15 @@ export async function createNote(value: string | IObject, resolver: Resolver, si
|
||||||
if (res.status === 'ok') {
|
if (res.status === 'ok') {
|
||||||
quote = res.res;
|
quote = res.res;
|
||||||
break;
|
break;
|
||||||
|
} else if (res.status === 'temperror) {
|
||||||
|
temperror = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!quote) {
|
if (!quote && temperror) {
|
||||||
if (results.some(x => x.status === 'temperror')) {
|
// could not resolve quote, try again later
|
||||||
throw new Error('quote resolve failed');
|
throw new Error('quote resolve failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const cw = note.summary === '' ? null : note.summary;
|
const cw = note.summary === '' ? null : note.summary;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue