fedimbed: nitter -> twitter cause people will complain :(
This commit is contained in:
parent
7557c8ae21
commit
76a5209577
1 changed files with 8 additions and 5 deletions
|
@ -49,7 +49,7 @@ const PLATFORM_COLORS = {
|
|||
pixelfed: 0x10c5f8,
|
||||
//cohost: 0x83254f,
|
||||
bluesky: 0x0085ff,
|
||||
nitter: 0xff6c60,
|
||||
nitter: 0x1da1f2,
|
||||
};
|
||||
|
||||
const BSKY_DOMAINS = [
|
||||
|
@ -964,12 +964,15 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
|
||||
let platform = (await resolvePlatform(url)) ?? "<no nodeinfo>";
|
||||
|
||||
let realUrl = url;
|
||||
if (PATH_REGEX.twitter.test(urlObj.pathname)) {
|
||||
let hostname = urlObj.hostname.replace(/^www\./, "");
|
||||
if (TW_DOMAINS.includes(hostname)) {
|
||||
if (canTwitter === true) {
|
||||
urlObj.hostname = "tw.c7.pm";
|
||||
url = urlObj.toString();
|
||||
urlObj.hostName = "twitter.com";
|
||||
realUrl = urlObj.toString();
|
||||
hostname = "tw.c7.pm";
|
||||
platform = "Nitter";
|
||||
}
|
||||
|
@ -1318,7 +1321,7 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
}
|
||||
|
||||
if (platformName.includes("Nitter") && platformName.includes(" \u2022 ")) {
|
||||
const [nn, ns] = platformName.split(" \u2022 ");
|
||||
const [_, ns] = platformName.split(" \u2022 ");
|
||||
stats = ns
|
||||
.replace("\u21a9", Icons.fedimbed.reply)
|
||||
.replace("\ud83d\udd01", Icons.fedimbed.repost)
|
||||
|
@ -1327,10 +1330,10 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
.replace("\ud83d\udd16", Icons.fedimbed.bookmark)
|
||||
.replace("\ud83d\udc41", Icons.fedimbed.views)
|
||||
.replaceAll(/ <:i:/g, "\u3000<:i:");
|
||||
platformName = nn;
|
||||
platformName = "Twitter";
|
||||
}
|
||||
|
||||
if (platformName == "Nitter") {
|
||||
if (platformName == "Twitter") {
|
||||
const newHandle = author.handle.split("@")[0];
|
||||
author.handle = "@" + newHandle;
|
||||
|
||||
|
@ -1429,7 +1432,7 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
|||
type: 2,
|
||||
style: 5,
|
||||
label: "View Post",
|
||||
url,
|
||||
url: realUrl,
|
||||
},
|
||||
};
|
||||
if (images.length > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue