Compare commits

..

2 commits

Author SHA1 Message Date
9c07d23f90
presence: somehow didnt try catch this 2025-12-01 16:15:45 -07:00
80b59f5046
fedimbed: epic typo 2025-12-01 16:13:47 -07:00
3 changed files with 33 additions and 21 deletions

View file

@ -847,7 +847,7 @@ async function fetchPost(url, platform, forceMastoAPI = false) {
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
} else if (PATH_REGEX.twitter.text(urlObj.pathname)) {
} else if (PATH_REGEX.twitter.test(urlObj.pathname)) {
const postId = urlObj.pathname.match(PATH_REGEX.twitter)?.[2];
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {

View file

@ -389,6 +389,7 @@ presence.callback = async function (msg, line) {
image_links.push({label: "Small Image", url: fixMediaProxyURL(smallUrl)});
}
try {
const largeImage = await fetch(largeUrl)
.then((res) => res.arrayBuffer())
.then((b) => Buffer.from(b));
@ -412,6 +413,9 @@ presence.callback = async function (msg, line) {
name: `${index}.png`,
});
thumbnail = `attachment://${index}.png`;
} catch {
thumbnail = fixMediaProxyURL(largeUrl);
}
} else if (!activity.assets.large_image && activity.assets.small_image != null) {
let smallUrl;
if (activity.assets.small_image.startsWith("mp:")) {

View file

@ -68,7 +68,15 @@ module.exports.ApplicationFlags.SOCIAL_LAYER_INTEGRATION = 1 << 27; //
module.exports.ApplicationFlags.PROMOTED = 1 << 29; // prettier-ignore
module.exports.ApplicationFlags.PARTNER = 1 << 30; // prettier-ignore
module.exports.ApplicationTypes = ["Normal", "Game", "Music", "Ticketed Event", "Creator Monetization", "Game"];
module.exports.ApplicationTypes = [
"Normal",
"Game",
"Music",
"Ticketed Event",
"Creator Monetization",
"Game",
"Non-Game Detectable",
];
module.exports.AuditLogActions.SOUNDBOARD_SOUND_CREATE = 130;
module.exports.AuditLogActions.SOUNDBOARD_SOUND_UPDATE = 131;