fedimbed: account for deleted quotes on twitter
This commit is contained in:
parent
f8cb62578b
commit
058973602f
1 changed files with 21 additions and 11 deletions
|
@ -1568,19 +1568,29 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
||||||
const components = [cw.length > 0 && warningText, container];
|
const components = [cw.length > 0 && warningText, container];
|
||||||
|
|
||||||
if (quoteRes) {
|
if (quoteRes) {
|
||||||
const quoteComponents = quoteRes.response.components[0].components;
|
if (quoteRes.response != null) {
|
||||||
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
const quoteComponents = quoteRes.response.components[0].components;
|
||||||
if (quoteComponents[0].type == 10) {
|
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
||||||
quoteComponents[0].content = minimal
|
if (quoteComponents[0].type == 10) {
|
||||||
? quoteComponents[0].content.replace(
|
quoteComponents[0].content = minimal
|
||||||
/^### /,
|
? quoteComponents[0].content.replace(
|
||||||
"$&" + Icons.fedimbed.quote.replace(":Quotes:", ":Quoting:") + " "
|
/^### /,
|
||||||
)
|
"$&" + Icons.fedimbed.quote.replace(":Quotes:", ":Quoting:") + " "
|
||||||
: quoteContext + "\n" + quoteComponents[0].content;
|
)
|
||||||
|
: quoteContext + "\n" + quoteComponents[0].content;
|
||||||
|
} else {
|
||||||
|
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
||||||
|
}
|
||||||
|
container.components.push({type: 14}, ...quoteComponents);
|
||||||
} else {
|
} else {
|
||||||
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
container.components.push(
|
||||||
|
{type: 14},
|
||||||
|
{
|
||||||
|
type: 10,
|
||||||
|
content: `-# ${Icons.fedimbed.quote} Quoted post was deleted`,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
container.components.push({type: 14}, ...quoteComponents);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue