fedimbed: function overload moment
This commit is contained in:
parent
c8c73baa24
commit
12a2e222b7
1 changed files with 1 additions and 6 deletions
|
@ -1242,9 +1242,8 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
if (headTag) {
|
||||
for (const tag of headTag.link) {
|
||||
if (tag.$rel == "icon" || tag.$rel == "apple-touch-icon") {
|
||||
logger.verbose("fedimbed", `icon tag: ${JSON.stringify(tag)}`);
|
||||
if (tag.$sizes) {
|
||||
const [w, h] = tag.$sizes.split("x").map(parseInt);
|
||||
const [w, h] = tag.$sizes.split("x").map((x) => parseInt(x));
|
||||
const size = w * h;
|
||||
if (size > lastIconSize) {
|
||||
lastIconSize = size;
|
||||
|
@ -1269,14 +1268,10 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
}
|
||||
}
|
||||
|
||||
logger.verbose("fedimbed", `icon pre: ${icon}`);
|
||||
|
||||
if (icon && icon.startsWith("/")) {
|
||||
icon = urlObj.origin + icon;
|
||||
}
|
||||
|
||||
logger.verbose("fedimbed", `icon post: ${icon}`);
|
||||
|
||||
const baseEmbed = {
|
||||
color,
|
||||
url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue