Merge remote-tracking branch 'upstream/dev' into dev

This commit is contained in:
thororen 2026-08-27 23:21:01 -04:00
commit 6984e06c9e
No known key found for this signature in database
8 changed files with 48 additions and 7 deletions

View file

@ -37,9 +37,8 @@ export default definePlugin({
{
find: ".handleSendMessage,onResize:",
replacement: {
// https://regex101.com/r/7iswuk/1
match: /let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\((\{.+?\})\),.{0,100}?\};(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
replace: (m, parsedMessage, channel, contentOptions, options, props) => m +
match: /(?<=channel:\i\}\)\.then\()(?:async )?(\i=>.+?let (\i)=\i\.\i\.parse\((\i),.+?\.getSendMessageOptions\((\{.+?\})\),.{0,100}?\};)(?=.+?(\i)\.flags=)(?<=\)\(({.+?})\)\.then.+?)/,
replace: (m, restCode, parsedMessage, channel, contentOptions, options, props) => "async " + restCode +
`if(await Vencord.Api.MessageEvents._handlePreSend(${channel}.id,${parsedMessage},${options},${props},${contentOptions}))` +
"return{shouldClear:false,shouldRefocus:true};"
}

View file

@ -55,6 +55,8 @@ export function GetOsColor(os: string) {
case "Mac OS X":
case "iOS":
return ""; // Default to white/black (theme-dependent)
case "Horizon OS": // For Meta Quest (not to be confused with Horizon OS for the Nintendo Switch)
return "#0081fb"; // A bright blue, more vibrant and strong and a bit darker than Windows
default:
return "#f3799a"; // Pink
}
@ -65,6 +67,7 @@ export function GetPlatformIcon(platform: string) {
case "Discord Android":
case "Discord iOS":
case "Discord Client":
case "Discord VR":
return DiscordIcon;
case "Android Chrome":
case "Chrome iOS":

View file

@ -326,7 +326,7 @@ export default definePlugin({
},
// Allow users to use custom client themes
{
find: '("custom_themes_editor_footer")',
find: ".CLIENT_THEMES_EDITOR?",
replacement: {
match: /(?<=\i=)\(0,\i\.\i\)\(\i\.\i\.TIER_2\)(?=,|;)/g,
replace: "true"

View file

@ -153,6 +153,10 @@ export const Magnifier = ErrorBoundary.wrap<MagnifierProps>(({ instance, size: i
const imageSrc = useMemo(() => {
try {
const imageUrl = new URL(instance.props.src);
if (imageUrl.protocol !== "http:" && imageUrl.protocol !== "https:")
return instance.props.src;
if (imageUrl.pathname.startsWith("/attachments/"))
imageUrl.hostname = "cdn.discordapp.com";

View file

@ -371,6 +371,12 @@ export const settings = definePluginSettings({
description: "Whether to log edited messages",
default: true,
},
logDeletedAttachments: {
type: OptionType.BOOLEAN,
description: "Whether to log deleted attachments",
default: true,
restartNeeded: true,
},
inlineEdits: {
type: OptionType.BOOLEAN,
description: "Whether to display edit history as part of message content",
@ -379,7 +385,7 @@ export const settings = definePluginSettings({
ignoreBots: {
type: OptionType.BOOLEAN,
description: "Whether to ignore messages by bots",
default: false,
default: true,
},
ignoreSelf: {
type: OptionType.BOOLEAN,
@ -795,6 +801,7 @@ export default definePlugin({
// just mark deleted attachments as deleted on MESSAGE_UPDATE
{
match: /attachments:(\i)\.attachments\?\?\[\],/,
predicate: () => settings.store.logDeletedAttachments,
replace: "attachments: $self.handleUpdateAttachments($1),"
}
]

View file

@ -247,7 +247,7 @@ export default definePlugin({
replacement: {
match: /null==\i\.icon\?.+?src:(\(0,\i\.\i\).+?\))(?=[,}])/,
// We have to check that icon is not an unread GDM in the server bar
replace: (m, iconUrl) => `${m},onClick:vcEvent=>arguments[0]?.size!=="SIZE_48"&&$self.openAvatar(${iconUrl},vcEvent)`
replace: (m, iconUrl) => `${m},onClick:vcEvent=>arguments[0]?.size!=="SIZE_40"&&$self.openAvatar(${iconUrl},vcEvent)`
}
},
// User DMs top small icon

View file

@ -19,6 +19,7 @@
import { definePluginSettings } from "@api/Settings";
import { Devs, IS_MAC } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
import { SettingsRouter } from "@webpack/common";
const settings = definePluginSettings({
showNavigationButtons: {
@ -63,6 +64,26 @@ export default definePlugin({
}
],
start() {
document.addEventListener("keydown", this.onKey);
},
stop() {
document.removeEventListener("keydown", this.onKey);
},
onKey(e: KeyboardEvent) {
const hasCtrl = e.ctrlKey || (e.metaKey && IS_MAC);
// Cmd+, is a native shortcut on macos (Vesktop/src/main/mainWindow.ts)
const hasNativeShortcut = IS_VESKTOP && IS_MAC;
if (hasCtrl && e.key === "," && !hasNativeShortcut) {
e.preventDefault();
SettingsRouter.openUserSettings();
}
},
getBlockedKeybinds() {
// Zoom shortcuts, allowing these would cause unpredictable zooming behavior on macos
const blocked: string[] = ["mod+plus", "mod+minus", "mod+0"];

View file

@ -10,7 +10,7 @@ import definePlugin from "@utils/types";
export default definePlugin({
name: "WebScreenShareFixes",
authors: [Devs.Kaitlyn],
description: "Removes 2500kbps bitrate cap on chromium and vesktop clients.",
description: "Removes 2500kbps bitrate cap on chromium and vesktop clients and fixes CPU usage growing endlessly while screensharing.",
tags: ["Voice"],
enabledByDefault: true,
@ -27,6 +27,13 @@ export default definePlugin({
replace: '$&${$1?";stereo=1;sprop-stereo=1":""}'
},
]
},
{
find: "ApplicationStreamPreviewUploadManager",
replacement: {
match: /(\i)\.removeAttribute\("srcObject"\)/,
replace: "$1.pause(),$1.srcObject=null"
}
}
]
});