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

This commit is contained in:
thororen1234 2026-02-05 18:14:20 -05:00
commit 7f5fcd815c
No known key found for this signature in database
10 changed files with 23 additions and 43 deletions

View file

@ -34,6 +34,7 @@ import { debounce } from "@shared/debounce";
import { IS_WINDOWS } from "@utils/constants";
import { createAndAppendStyle } from "@utils/css";
import { StartAt } from "@utils/types";
import { SettingsRouter } from "@webpack/common";
import { get as dsGet } from "./api/DataStore";
import { popNotice, showNotice } from "./api/Notices";
@ -45,7 +46,6 @@ import { localStorage } from "./utils/localStorage";
import { relaunch } from "./utils/native";
import { checkForUpdates, isOutdated as getIsOutdated, update, UpdateLogger } from "./utils/updater";
import { onceReady } from "./webpack";
import { openUserSettingsPanel } from "./webpack/common";
import { patches } from "./webpack/patchWebpack";
if (IS_REPORTER) {
@ -66,7 +66,7 @@ async function syncSettings() {
title: "Cloud Settings",
body: "Cloud sync was disabled because this account isn't connected to the cloud App. You can enable it again by connecting this account in Cloud Settings. (note: it will store your preferences separately)",
color: "var(--yellow-360)",
onClick: () => openUserSettingsPanel("equicord_cloud")
onClick: () => SettingsRouter.openUserSettings("equicord_cloud_panel")
});
// Disable cloud sync globally
Settings.cloud.authenticated = false;
@ -85,7 +85,7 @@ async function syncSettings() {
body: "We've noticed you have cloud integrations enabled in another client! Due to limitations, you will " +
"need to re-authenticate to continue using them. Click here to go to the settings page to do so!",
color: "var(--yellow-360)",
onClick: () => openUserSettingsPanel("equicord_cloud")
onClick: () => SettingsRouter.openUserSettings("equicord_cloud_panel")
});
return;
}

View file

@ -14,7 +14,7 @@ export default definePlugin({
patches: [
{
// TODO: bundler compat
find: /\.renderLinkComponent[)?]\?/,
find: ".renderLinkComponent",
replacement: {
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,

View file

@ -100,14 +100,9 @@ export default definePlugin({
{
find: "this.renderArtisanalHack()",
replacement: [
{ // Fade in on layer
// class Layer {
// static contextType = ...;
// ...
// }
// class OtherClass {
match: /(static contextType=\i\.\i;.+?})(?=class)(?<=class (\i).+?)/,
replace: (_, before, Layer) => `${before};${Layer}=$self.Layer;`,
{
match: /class (\i)(?= extends \i\.PureComponent.+?static contextType=.+?jsx\)\(\1,\{mode:)/,
replace: "var $1=$self.Layer;class VencordPatchedOldFadeLayer",
predicate: () => settings.store.disableFade
},
{ // Lazy-load contents

View file

@ -103,6 +103,10 @@ export default definePlugin({
].map(find => ({
find,
replacement: [
{
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
},
{
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
replace: "$self.useUserDecorAvatarDecoration($2)??$1"

View file

@ -1,26 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2023 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "NormalizeMessageLinks",
description: "Strip canary/ptb from message links",
authors: [Devs.bb010g],
patches: [
{
find: "#{intl::COPY_MESSAGE_LINK}",
replacement: {
match: /(?<=(?:.concat\(|\/\/\$\{))location\.host/,
replace: "$self.normalizeHost(location.host)",
},
},
],
normalizeHost(host: string) {
return host.replace(/(^|\b)(canary\.|ptb\.)(discord.com)$/, "$1$3");
},
});

View file

@ -40,7 +40,7 @@ export interface Session {
const SessionsStore = findStoreLazy("SessionsStore") as {
getSessions(): Record<string, Session>;
};
const { useStatusFillColor } = mapMangledModuleLazy("translate(${.5625*", {
const { useStatusFillColor } = mapMangledModuleLazy([".5625*", "translate"], {
useStatusFillColor: filters.byCode(".hex")
});

View file

@ -352,6 +352,13 @@ export default definePlugin({
match: /\i>0(?=&&!\i&&!\i)/,
replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})`
},
{
// Show only the plus text without overflowed children amount
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
match: /(?<=`\+\$\{)\i(?=\})/,
replace: overflowTextAmount => "" +
`$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}`
},
{
// Show only the plus text without overflowed children amount
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen

View file

@ -52,7 +52,7 @@ export default definePlugin({
},
},
{
find: /\.INVITES_DISABLED\)(?:\))?\|\|/,
find: "INVITES_DISABLED)||",
predicate: () => settings.store.showInvitesPaused,
replacement: {
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,

View file

@ -131,7 +131,7 @@ export default definePlugin({
replace: "$self.renderTypingUsers({ users: arguments[0]?.typingUserObjects, guildId: arguments[0]?.channel?.guild_id, children: $& })"
},
{
match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,...\i\})/,
match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,\.\.\.\i\})/,
replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);"
},
{

View file

@ -19,7 +19,7 @@
import { Devs, IS_MAC } from "@utils/constants";
import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { ComponentDispatch, FluxDispatcher, NavigationRouter, openUserSettingsPanel, SelectedGuildStore } from "@webpack/common";
import { ComponentDispatch, FluxDispatcher, NavigationRouter, SelectedGuildStore, SettingsRouter } from "@webpack/common";
const KeyBinds = findByPropsLazy("JUMP_TO_GUILD", "SERVER_NEXT");
@ -55,7 +55,7 @@ export default definePlugin({
break;
case ",":
e.preventDefault();
openUserSettingsPanel("my_account");
SettingsRouter.openUserSettings("my_account_panel");
break;
default:
if (e.key >= "1" && e.key <= "9") {