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,6 +1568,7 @@ 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) {
|
||||||
|
if (quoteRes.response != null) {
|
||||||
const quoteComponents = quoteRes.response.components[0].components;
|
const quoteComponents = quoteRes.response.components[0].components;
|
||||||
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
const quoteContext = `-# ${Icons.fedimbed.quote} Quoted Post`;
|
||||||
if (quoteComponents[0].type == 10) {
|
if (quoteComponents[0].type == 10) {
|
||||||
|
@ -1581,6 +1582,15 @@ async function processUrl(msg, url, spoiler = false, command = false, inQuote =
|
||||||
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
quoteComponents.splice(0, 0, {type: 10, content: quoteContext});
|
||||||
}
|
}
|
||||||
container.components.push({type: 14}, ...quoteComponents);
|
container.components.push({type: 14}, ...quoteComponents);
|
||||||
|
} else {
|
||||||
|
container.components.push(
|
||||||
|
{type: 14},
|
||||||
|
{
|
||||||
|
type: 10,
|
||||||
|
content: `-# ${Icons.fedimbed.quote} Quoted post was deleted`,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue