Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
7f5fcd815c
10 changed files with 23 additions and 43 deletions
|
|
@ -34,6 +34,7 @@ import { debounce } from "@shared/debounce";
|
||||||
import { IS_WINDOWS } from "@utils/constants";
|
import { IS_WINDOWS } from "@utils/constants";
|
||||||
import { createAndAppendStyle } from "@utils/css";
|
import { createAndAppendStyle } from "@utils/css";
|
||||||
import { StartAt } from "@utils/types";
|
import { StartAt } from "@utils/types";
|
||||||
|
import { SettingsRouter } from "@webpack/common";
|
||||||
|
|
||||||
import { get as dsGet } from "./api/DataStore";
|
import { get as dsGet } from "./api/DataStore";
|
||||||
import { popNotice, showNotice } from "./api/Notices";
|
import { popNotice, showNotice } from "./api/Notices";
|
||||||
|
|
@ -45,7 +46,6 @@ import { localStorage } from "./utils/localStorage";
|
||||||
import { relaunch } from "./utils/native";
|
import { relaunch } from "./utils/native";
|
||||||
import { checkForUpdates, isOutdated as getIsOutdated, update, UpdateLogger } from "./utils/updater";
|
import { checkForUpdates, isOutdated as getIsOutdated, update, UpdateLogger } from "./utils/updater";
|
||||||
import { onceReady } from "./webpack";
|
import { onceReady } from "./webpack";
|
||||||
import { openUserSettingsPanel } from "./webpack/common";
|
|
||||||
import { patches } from "./webpack/patchWebpack";
|
import { patches } from "./webpack/patchWebpack";
|
||||||
|
|
||||||
if (IS_REPORTER) {
|
if (IS_REPORTER) {
|
||||||
|
|
@ -66,7 +66,7 @@ async function syncSettings() {
|
||||||
title: "Cloud Settings",
|
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)",
|
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)",
|
color: "var(--yellow-360)",
|
||||||
onClick: () => openUserSettingsPanel("equicord_cloud")
|
onClick: () => SettingsRouter.openUserSettings("equicord_cloud_panel")
|
||||||
});
|
});
|
||||||
// Disable cloud sync globally
|
// Disable cloud sync globally
|
||||||
Settings.cloud.authenticated = false;
|
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 " +
|
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!",
|
"need to re-authenticate to continue using them. Click here to go to the settings page to do so!",
|
||||||
color: "var(--yellow-360)",
|
color: "var(--yellow-360)",
|
||||||
onClick: () => openUserSettingsPanel("equicord_cloud")
|
onClick: () => SettingsRouter.openUserSettings("equicord_cloud_panel")
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export default definePlugin({
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
// TODO: bundler compat
|
// TODO: bundler compat
|
||||||
find: /\.renderLinkComponent[)?]\?/,
|
find: ".renderLinkComponent",
|
||||||
replacement: {
|
replacement: {
|
||||||
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
|
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
|
||||||
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,
|
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,
|
||||||
|
|
|
||||||
|
|
@ -100,14 +100,9 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "this.renderArtisanalHack()",
|
find: "this.renderArtisanalHack()",
|
||||||
replacement: [
|
replacement: [
|
||||||
{ // Fade in on layer
|
{
|
||||||
// class Layer {
|
match: /class (\i)(?= extends \i\.PureComponent.+?static contextType=.+?jsx\)\(\1,\{mode:)/,
|
||||||
// static contextType = ...;
|
replace: "var $1=$self.Layer;class VencordPatchedOldFadeLayer",
|
||||||
// ...
|
|
||||||
// }
|
|
||||||
// class OtherClass {
|
|
||||||
match: /(static contextType=\i\.\i;.+?})(?=class)(?<=class (\i).+?)/,
|
|
||||||
replace: (_, before, Layer) => `${before};${Layer}=$self.Layer;`,
|
|
||||||
predicate: () => settings.store.disableFade
|
predicate: () => settings.store.disableFade
|
||||||
},
|
},
|
||||||
{ // Lazy-load contents
|
{ // Lazy-load contents
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@ export default definePlugin({
|
||||||
].map(find => ({
|
].map(find => ({
|
||||||
find,
|
find,
|
||||||
replacement: [
|
replacement: [
|
||||||
|
{
|
||||||
|
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
|
||||||
|
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
|
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
|
||||||
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
|
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
|
||||||
|
|
|
||||||
|
|
@ -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");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
@ -40,7 +40,7 @@ export interface Session {
|
||||||
const SessionsStore = findStoreLazy("SessionsStore") as {
|
const SessionsStore = findStoreLazy("SessionsStore") as {
|
||||||
getSessions(): Record<string, Session>;
|
getSessions(): Record<string, Session>;
|
||||||
};
|
};
|
||||||
const { useStatusFillColor } = mapMangledModuleLazy("translate(${.5625*", {
|
const { useStatusFillColor } = mapMangledModuleLazy([".5625*", "translate"], {
|
||||||
useStatusFillColor: filters.byCode(".hex")
|
useStatusFillColor: filters.byCode(".hex")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -352,6 +352,13 @@ export default definePlugin({
|
||||||
match: /\i>0(?=&&!\i&&!\i)/,
|
match: /\i>0(?=&&!\i&&!\i)/,
|
||||||
replace: m => `($self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)?true:${m})`
|
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
|
// Show only the plus text without overflowed children amount
|
||||||
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
// if the overflow amount is <= 0 and the component is used inside the HiddenChannelLockScreen
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: /\.INVITES_DISABLED\)(?:\))?\|\|/,
|
find: "INVITES_DISABLED)||",
|
||||||
predicate: () => settings.store.showInvitesPaused,
|
predicate: () => settings.store.showInvitesPaused,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
|
match: /\i\.\i\.can\(\i\.\i.MANAGE_GUILD,\i\)/,
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ export default definePlugin({
|
||||||
replace: "$self.renderTypingUsers({ users: arguments[0]?.typingUserObjects, guildId: arguments[0]?.channel?.guild_id, children: $& })"
|
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);"
|
replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
import { Devs, IS_MAC } from "@utils/constants";
|
import { Devs, IS_MAC } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
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");
|
const KeyBinds = findByPropsLazy("JUMP_TO_GUILD", "SERVER_NEXT");
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ export default definePlugin({
|
||||||
break;
|
break;
|
||||||
case ",":
|
case ",":
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
openUserSettingsPanel("my_account");
|
SettingsRouter.openUserSettings("my_account_panel");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (e.key >= "1" && e.key <= "9") {
|
if (e.key >= "1" && e.key <= "9") {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue