Compare commits
2 commits
531eabef97
...
9c07d23f90
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c07d23f90 | |||
| 80b59f5046 |
3 changed files with 33 additions and 21 deletions
|
|
@ -847,7 +847,7 @@ async function fetchPost(url, platform, forceMastoAPI = false) {
|
||||||
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
||||||
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
||||||
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
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];
|
const postId = urlObj.pathname.match(PATH_REGEX.twitter)?.[2];
|
||||||
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
||||||
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,7 @@ presence.callback = async function (msg, line) {
|
||||||
image_links.push({label: "Small Image", url: fixMediaProxyURL(smallUrl)});
|
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((res) => res.arrayBuffer())
|
||||||
.then((b) => Buffer.from(b));
|
.then((b) => Buffer.from(b));
|
||||||
|
|
@ -412,6 +413,9 @@ presence.callback = async function (msg, line) {
|
||||||
name: `${index}.png`,
|
name: `${index}.png`,
|
||||||
});
|
});
|
||||||
thumbnail = `attachment://${index}.png`;
|
thumbnail = `attachment://${index}.png`;
|
||||||
|
} catch {
|
||||||
|
thumbnail = fixMediaProxyURL(largeUrl);
|
||||||
|
}
|
||||||
} else if (!activity.assets.large_image && activity.assets.small_image != null) {
|
} else if (!activity.assets.large_image && activity.assets.small_image != null) {
|
||||||
let smallUrl;
|
let smallUrl;
|
||||||
if (activity.assets.small_image.startsWith("mp:")) {
|
if (activity.assets.small_image.startsWith("mp:")) {
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,15 @@ module.exports.ApplicationFlags.SOCIAL_LAYER_INTEGRATION = 1 << 27; //
|
||||||
module.exports.ApplicationFlags.PROMOTED = 1 << 29; // prettier-ignore
|
module.exports.ApplicationFlags.PROMOTED = 1 << 29; // prettier-ignore
|
||||||
module.exports.ApplicationFlags.PARTNER = 1 << 30; // 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_CREATE = 130;
|
||||||
module.exports.AuditLogActions.SOUNDBOARD_SOUND_UPDATE = 131;
|
module.exports.AuditLogActions.SOUNDBOARD_SOUND_UPDATE = 131;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue