fedimbed: fix emotes for platforms that dont use it, limmy old. redirect
This commit is contained in:
parent
a0c037b6e9
commit
784f2d9c20
1 changed files with 13 additions and 3 deletions
|
@ -105,6 +105,14 @@ async function signedFetch(url, options) {
|
||||||
|
|
||||||
async function processUrl(msg, url, spoiler = false) {
|
async function processUrl(msg, url, spoiler = false) {
|
||||||
let urlObj = new URL(url);
|
let urlObj = new URL(url);
|
||||||
|
|
||||||
|
// some limmy instances have old reddit frontend subdomains
|
||||||
|
// but these frontends are just frontends and dont actually expose the API
|
||||||
|
if (urlObj.hostname.startsWith("old.")) {
|
||||||
|
urlObj.hostname = urlObj.hostname.replace("old.", "");
|
||||||
|
url = urlObj.href;
|
||||||
|
}
|
||||||
|
|
||||||
let platform = await resolvePlatform(url);
|
let platform = await resolvePlatform(url);
|
||||||
let color = PLATFORM_COLORS[platform];
|
let color = PLATFORM_COLORS[platform];
|
||||||
let platformName = platform
|
let platformName = platform
|
||||||
|
@ -364,6 +372,8 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
if (!spoiler && postData.sensitive) {
|
if (!spoiler && postData.sensitive) {
|
||||||
spoiler = true;
|
spoiler = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (postData.tag)
|
||||||
emotes = postData.tag
|
emotes = postData.tag
|
||||||
.filter((x) => !!x.icon)
|
.filter((x) => !!x.icon)
|
||||||
.map((x) => ({name: x.name, url: x.icon.url}));
|
.map((x) => ({name: x.name, url: x.icon.url}));
|
||||||
|
|
Loading…
Reference in a new issue