Compare commits

..

No commits in common. "9c07d23f90a851ace600d0925295861be67a3c48" and "531eabef979279d2f1a16bcca75c0396670563f0" have entirely different histories.

3 changed files with 21 additions and 33 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.test(urlObj.pathname)) {
} else if (PATH_REGEX.twitter.text(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,33 +389,29 @@ presence.callback = async function (msg, line) {
image_links.push({label: "Small Image", url: fixMediaProxyURL(smallUrl)});
}
try {
const largeImage = await fetch(largeUrl)
const largeImage = await fetch(largeUrl)
.then((res) => res.arrayBuffer())
.then((b) => Buffer.from(b));
const presenceImage = sharp(largeImage).resize(100, 100);
if (smallUrl) {
const smallImage = await fetch(smallUrl)
.then((res) => res.arrayBuffer())
.then((b) => Buffer.from(b));
const presenceImage = sharp(largeImage).resize(100, 100);
if (smallUrl) {
const smallImage = await fetch(smallUrl)
.then((res) => res.arrayBuffer())
.then((b) => Buffer.from(b));
const smallImageBuffer = await sharp(smallImage).resize(32, 32).toBuffer();
const smallImageBuffer = await sharp(smallImage).resize(32, 32).toBuffer();
presenceImage.composite([
{
input: smallImageBuffer,
gravity: "southeast",
},
]);
}
files.push({
contents: await presenceImage.toBuffer(),
name: `${index}.png`,
});
thumbnail = `attachment://${index}.png`;
} catch {
thumbnail = fixMediaProxyURL(largeUrl);
presenceImage.composite([
{
input: smallImageBuffer,
gravity: "southeast",
},
]);
}
files.push({
contents: await presenceImage.toBuffer(),
name: `${index}.png`,
});
thumbnail = `attachment://${index}.png`;
} else if (!activity.assets.large_image && activity.assets.small_image != null) {
let smallUrl;
if (activity.assets.small_image.startsWith("mp:")) {

View file

@ -68,15 +68,7 @@ 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",
"Non-Game Detectable",
];
module.exports.ApplicationTypes = ["Normal", "Game", "Music", "Ticketed Event", "Creator Monetization", "Game"];
module.exports.AuditLogActions.SOUNDBOARD_SOUND_CREATE = 130;
module.exports.AuditLogActions.SOUNDBOARD_SOUND_UPDATE = 131;