fix remaining things broken by recent Discord update (#3966)
Co-authored-by: V <vendicated@riseup.net> Co-authored-by: thororen1234 <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
577407bab9
commit
3d4cf25659
43 changed files with 179 additions and 132 deletions
|
|
@ -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 { NotificationData, showNotification } from "./api/Notifications";
|
||||
|
|
@ -44,7 +45,6 @@ import { localStorage } from "./utils/localStorage";
|
|||
import { relaunch } from "./utils/native";
|
||||
import { checkForUpdates, update, UpdateLogger } from "./utils/updater";
|
||||
import { onceReady } from "./webpack";
|
||||
import { SettingsRouter } from "./webpack/common";
|
||||
import { patches } from "./webpack/patchWebpack";
|
||||
|
||||
if (IS_REPORTER) {
|
||||
|
|
@ -68,7 +68,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: () => SettingsRouter.open("VencordCloud")
|
||||
onClick: () => SettingsRouter.openUserSettings("vencord_cloud_panel")
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ export default definePlugin({
|
|||
description: "Allows you to omit either width or height when opening an image modal",
|
||||
patches: [
|
||||
{
|
||||
find: ".renderLinkComponent)?",
|
||||
// TODO: bundler compat
|
||||
find: ".renderLinkComponent",
|
||||
replacement: {
|
||||
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
|
||||
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export default definePlugin({
|
|||
patches: [
|
||||
{
|
||||
// Message accessories have a custom logic to decide if they should render again, so we need to make it not ignore changed message reference
|
||||
find: "}renderEmbeds(",
|
||||
find: "}renderStickersAccessories(",
|
||||
replacement: {
|
||||
match: /(?<=this.props,\i,\[)"message",/,
|
||||
replace: ""
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export default definePlugin({
|
|||
"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",
|
||||
patches: [
|
||||
{
|
||||
find: '"onCloseImage",',
|
||||
find: ".modalContext})};",
|
||||
replacement: {
|
||||
match: /(return.{0,10}\.jsx.{0,50}isWindowFocused)/,
|
||||
replace:
|
||||
|
|
|
|||
|
|
@ -13,11 +13,17 @@ export default definePlugin({
|
|||
authors: [Devs.Samwich],
|
||||
patches: [
|
||||
{
|
||||
find: '"state",{resultType:',
|
||||
replacement: [{
|
||||
match: /(?<="state",{resultType:)null/,
|
||||
replace: '"Favorites"'
|
||||
}]
|
||||
find: "renderHeaderContent(){",
|
||||
replacement: [
|
||||
{
|
||||
match: /(?<="state",{resultType:)null/,
|
||||
replace: '"Favorites"'
|
||||
},
|
||||
{
|
||||
match: /(?<=state={resultType:)null/,
|
||||
replace: '"Favorites"'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,15 +23,14 @@ import { definePluginSettings } from "@api/Settings";
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack";
|
||||
import { Constants, React, RestAPI, Tooltip } from "@webpack/common";
|
||||
import { findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack";
|
||||
import { Constants, React, RestAPI, SettingsRouter, Tooltip } from "@webpack/common";
|
||||
|
||||
import { RenameButton } from "./components/RenameButton";
|
||||
import { Session, SessionInfo } from "./types";
|
||||
import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils";
|
||||
|
||||
const AuthSessionsStore = findStoreLazy("AuthSessionsStore");
|
||||
const UserSettingsModal = findByPropsLazy("saveAccountChanges", "open");
|
||||
|
||||
const TimestampClasses = findCssClassesLazy("timestamp", "blockquoteContainer");
|
||||
const SessionIconClasses = findCssClassesLazy("sessionIcon");
|
||||
|
|
@ -175,7 +174,7 @@ export default definePlugin({
|
|||
title: "BetterSessions",
|
||||
body: `New session:\n${session.client_info.os} · ${session.client_info.platform} · ${session.client_info.location}`,
|
||||
permanent: true,
|
||||
onClick: () => UserSettingsModal.open("Sessions")
|
||||
onClick: () => SettingsRouter.openUserSettings("sessions_panel")
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ export default definePlugin({
|
|||
{
|
||||
find: "this.renderArtisanalHack()",
|
||||
replacement: [
|
||||
{ // Fade in on layer
|
||||
match: /(?<=\((\i),"contextType",\i\.\i\);)/,
|
||||
replace: "$1=$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
|
||||
|
|
@ -129,8 +129,8 @@ export default definePlugin({
|
|||
{ // Load menu TOC eagerly
|
||||
find: "#{intl::USER_SETTINGS_WITH_BUILD_OVERRIDE}",
|
||||
replacement: {
|
||||
match: /(\i)\(this,"handleOpenSettingsContextMenu",.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)).*?,(?=\1\(this)/,
|
||||
replace: "$&(async ()=>$2)(),"
|
||||
match: /(?=handleOpenSettingsContextMenu=.{0,100}?null!=\i&&.{0,100}?(await [^};]*?\)\)))/,
|
||||
replace: "_vencordBetterSettingsEagerLoad=(async ()=>$1)();"
|
||||
},
|
||||
predicate: () => settings.store.eagerLoad
|
||||
},
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default definePlugin({
|
|||
|
||||
patches: [
|
||||
{
|
||||
find: "}renderEmbeds(",
|
||||
find: "}renderStickersAccessories(",
|
||||
replacement: [
|
||||
{
|
||||
match: /(\.renderReactions\(\i\).+?className:)/,
|
||||
|
|
|
|||
|
|
@ -147,10 +147,16 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
find: "is not a valid locale.",
|
||||
replacement: {
|
||||
match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/,
|
||||
replace: "$self.Noop"
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /\i\.error(?=\(""\.concat\(\i," is not a valid locale."\)\))/,
|
||||
replace: "$self.Noop"
|
||||
},
|
||||
{
|
||||
match: /\i\.error(?=\(`\$\{\i\} is not a valid locale.`)/,
|
||||
replace: "$self.Noop"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: '"AppCrashedFatalReport: getLastCrash not supported."',
|
||||
|
|
@ -161,10 +167,16 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
find: "RPCServer:WSS",
|
||||
replacement: {
|
||||
match: /\i\.error\("Error: "\.concat\((\i)\.message/,
|
||||
replace: '!$1.message.includes("EADDRINUSE")&&$&'
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /\i\.error\("Error: "\.concat\((\i)\.message/,
|
||||
replace: '!$1.message.includes("EADDRINUSE")&&$&'
|
||||
},
|
||||
{
|
||||
match: /\i\.error\(`Error: \$\{(\i)\.message\}/,
|
||||
replace: '!$1.message.includes("EADDRINUSE")&&$&'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: "Tried getting Dispatch instance before instantiated",
|
||||
|
|
@ -182,17 +194,25 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
find: "failed to send analytics events",
|
||||
replacement: {
|
||||
match: /console\.error\("\[analytics\] failed to send analytics events query: "\.concat\(\i\)\)/,
|
||||
replace: ""
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /console\.error\("\[analytics\] failed to send analytics events query: "\.concat\(\i\)\)/,
|
||||
replace: ""
|
||||
},
|
||||
{
|
||||
match: /console\.error\(`\[analytics\] failed to send analytics events query: \$\{\i\}`\)/,
|
||||
replace: ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: "Slow dispatch on",
|
||||
replacement: {
|
||||
match: /\i\.totalTime>\i&&\i\.verbose\("Slow dispatch on ".+?\)\);/,
|
||||
replace: ""
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /\i\.totalTime>\i&&\i\.verbose\([`"]Slow dispatch on.{0,55}\);/,
|
||||
replace: ""
|
||||
},
|
||||
]
|
||||
},
|
||||
// Patches Discord generic logger function
|
||||
{
|
||||
|
|
|
|||
|
|
@ -247,11 +247,13 @@ export default definePlugin({
|
|||
|
||||
patches: [
|
||||
{
|
||||
find: 'this,"_changeCallbacks",',
|
||||
replacement: {
|
||||
match: /\i\(this,"_changeCallbacks",/,
|
||||
replace: "Reflect.defineProperty(this,Symbol.toStringTag,{value:this.getName(),configurable:!0,writable:!0,enumerable:!1}),$&"
|
||||
}
|
||||
find: "&&this.initializeIfNeeded()",
|
||||
replacement: [
|
||||
{
|
||||
match: /\i&&this\.initializeIfNeeded\(\)/,
|
||||
replace: "$&,Reflect.defineProperty(this,Symbol.toStringTag,{value:this.getName(),configurable:!0,writable:!0,enumerable:!1})"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ export default definePlugin({
|
|||
// Discord hides buttons on your own Rich Presence for some reason. This patch disables that behaviour
|
||||
patches: [
|
||||
{
|
||||
find: ".buttons.length)>=1",
|
||||
find: ".USER_PROFILE_ACTIVITY_BUTTONS),",
|
||||
replacement: {
|
||||
match: /.getId\(\)===\i.id/,
|
||||
replace: "$& && false"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export default definePlugin({
|
|||
find: "80,onlyAnimateOnHoverOrFocus:!",
|
||||
replacement: [
|
||||
{
|
||||
match: /(?<==)\i=>{let{children.{20,200}isSelected:\i=!1\}=\i/,
|
||||
match: /(?<==)\i=>{let{children.{20,200}isSelected:\i=!1.{0,5}\}=\i/,
|
||||
replace: "$self.DecorationGridItem=$&",
|
||||
},
|
||||
{
|
||||
|
|
@ -106,6 +106,10 @@ export default definePlugin({
|
|||
{
|
||||
match: /(?<=userValue.{0,25}void 0:)((\i)\.avatarDecoration)/,
|
||||
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
|
||||
},
|
||||
{
|
||||
match: /(?<=userValue:)((\i)(?:.{0,10})?\.avatarDecoration)/,
|
||||
replace: "$self.useUserDecorAvatarDecoration($2)??$1"
|
||||
}
|
||||
]
|
||||
})),
|
||||
|
|
@ -114,7 +118,7 @@ export default definePlugin({
|
|||
find: "#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}",
|
||||
replacement: {
|
||||
match: /(#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}.+?return null!=(\i)&&\()(null==\i)/,
|
||||
replace: (_, rest, avatarDecoration, hasPurchase) => `${rest}(${avatarDecoration}.skuId!==$self.SKU_ID&&${hasPurchase})`
|
||||
replace: (_, rest, avatarDecoration, hasPurchase) => `${rest}(${avatarDecoration}.skuId!==$self.SKU_ID&&${avatarDecoration}.skuId!==$self.RAW_SKU_ID&&${hasPurchase})`
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -140,6 +144,7 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
SKU_ID,
|
||||
RAW_SKU_ID,
|
||||
|
||||
useUserDecorAvatarDecoration,
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeade
|
|||
import { filters, findComponentByCodeLazy, mapMangledModuleLazy } from "@webpack";
|
||||
import { Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Text, TextInput, useEffect, useMemo, UserStore, useState } from "@webpack/common";
|
||||
|
||||
const FileUpload = findComponentByCodeLazy(".currentTarget.files)", "lineClamp:1");
|
||||
const FileUpload = findComponentByCodeLazy(".currentTarget.files", "lineClamp:1");
|
||||
|
||||
const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', {
|
||||
HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO"),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import { Forms, React } from "@webpack/common";
|
|||
import hideBugReport from "./hideBugReport.css?managed";
|
||||
|
||||
const KbdStyles = findByPropsLazy("key", "combo");
|
||||
const BugReporterExperiment = findLazy(m => m?.definition?.id === "2024-09_bug_reporter");
|
||||
const BugReporterExperiment = findLazy(m => m?.definition?.name === "2026-01-bug-reporter");
|
||||
|
||||
const modKey = IS_MAC ? "cmd" : "ctrl";
|
||||
const altKey = IS_MAC ? "opt" : "alt";
|
||||
|
|
@ -109,6 +109,7 @@ export default definePlugin({
|
|||
find: "Clear Treatment ",
|
||||
replacement: [
|
||||
{
|
||||
// TODO: stable compat optional chaining remove once some time has passed
|
||||
match: /\i\??\.isStaff\(\)/,
|
||||
replace: "true"
|
||||
},
|
||||
|
|
@ -129,7 +130,7 @@ export default definePlugin({
|
|||
}
|
||||
],
|
||||
|
||||
start: () => !BugReporterExperiment.getCurrentConfig().hasBugReporterAccess && enableStyle(hideBugReport),
|
||||
start: () => !BugReporterExperiment.getConfig().hasBugReporterAccess && enableStyle(hideBugReport),
|
||||
stop: () => disableStyle(hideBugReport),
|
||||
|
||||
settingsAboutComponent: () => {
|
||||
|
|
|
|||
|
|
@ -293,13 +293,13 @@ export default definePlugin({
|
|||
{
|
||||
// Patch the rendered message content to add fake nitro emojis or remove sticker links
|
||||
predicate: () => settings.store.transformEmojis || settings.store.transformStickers,
|
||||
match: /(?=return{hasSpoilerEmbeds:\i,content:(\i))/,
|
||||
match: /(?=return{hasSpoilerEmbeds:\i,hasBailedAst:\i,content:(\i))/,
|
||||
replace: (_, content) => `${content}=$self.patchFakeNitroEmojisOrRemoveStickersLinks(${content},arguments[2]?.formatInline);`
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: "}renderEmbeds(",
|
||||
find: "}renderStickersAccessories(",
|
||||
replacement: [
|
||||
{
|
||||
// Call our function to decide whether the embed should be ignored or not
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ interface CopyIdMenuItemProps {
|
|||
}
|
||||
|
||||
let CopyIdMenuItem: (props: CopyIdMenuItemProps) => React.ReactElement | null = NoopComponent;
|
||||
waitFor(filters.componentByCode('"devmode-copy-id-".concat'), m => CopyIdMenuItem = m);
|
||||
waitFor(filters.componentByCode('"cannot copy null text"'), m => CopyIdMenuItem = m);
|
||||
|
||||
function MessageMenu({ message, channel, onHeightUpdate }) {
|
||||
const canReport = message.author &&
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export default definePlugin({
|
|||
patches: [
|
||||
{
|
||||
// Same find as RoleColorEverywhere chatbox mentions
|
||||
find: ':"text":',
|
||||
find: '"text":"locked"',
|
||||
replacement: {
|
||||
match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/,
|
||||
replace: "$1return $self.UserMentionComponent({...arguments[0],originalComponent:()=>{$2}});"
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ export default definePlugin({
|
|||
authors: [Devs.Ven],
|
||||
|
||||
patches: [{
|
||||
find: '"handleSelectGIF",',
|
||||
find: "handleSelectGIF=",
|
||||
replacement: {
|
||||
match: /"handleSelectGIF",(\i)=>\{/,
|
||||
replace: '"handleSelectGIF",$1=>{if (!this.props.className) return $self.handleSelect($1);'
|
||||
match: /handleSelectGIF=(\i)=>\{/,
|
||||
replace: "$&if (!this.props.className) return $self.handleSelect($1);"
|
||||
}
|
||||
}],
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ export default definePlugin({
|
|||
|
||||
patches: [
|
||||
{
|
||||
find: ".renderLinkComponent)?",
|
||||
find: "disableArrowKeySeek:!0",
|
||||
replacement: [
|
||||
{
|
||||
match: /useFullWidth:!0,shouldLink:/,
|
||||
|
|
|
|||
|
|
@ -66,11 +66,11 @@ export default definePlugin({
|
|||
find: "#{intl::LOADING_DID_YOU_KNOW}",
|
||||
replacement: [
|
||||
{
|
||||
match: /"_loadingText".+?(?=(\i)\[.{0,10}\.random)/,
|
||||
match: /_loadingText.+?(?=(\i)\[.{0,10}\.random)/,
|
||||
replace: "$&$self.mutateQuotes($1),"
|
||||
},
|
||||
{
|
||||
match: /"_eventLoadingText".+?(?=(\i)\[.{0,10}\.random)/,
|
||||
match: /_eventLoadingText.+?(?=(\i)\[.{0,10}\.random)/,
|
||||
replace: "$&$self.mutateQuotes($1),",
|
||||
predicate: () => settings.store.replaceEvents
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,10 +49,16 @@ export default definePlugin({
|
|||
|
||||
patches: [{
|
||||
find: ".USER_MENTION)",
|
||||
replacement: {
|
||||
match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/,
|
||||
replace: "children:$self.renderUsername({username:$1,user:$2})"
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/,
|
||||
replace: "children:$self.renderUsername({username:$1,user:$2})"
|
||||
},
|
||||
{
|
||||
match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/,
|
||||
replace: "children:$self.renderUsername({username:$1,user:$2})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
find: ".ROLE_MENTION)",
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ export default definePlugin({
|
|||
|
||||
{
|
||||
// Updated message transformer(?)
|
||||
find: "THREAD_STARTER_MESSAGE?null==",
|
||||
find: ".PREMIUM_REFERRAL&&(",
|
||||
replacement: [
|
||||
{
|
||||
// Pass through editHistory & deleted & original attachments to the "edited message" transformer
|
||||
|
|
|
|||
|
|
@ -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: ".concat($self.normalizeHost(location.host))",
|
||||
},
|
||||
},
|
||||
],
|
||||
normalizeHost(host: string) {
|
||||
return host.replace(/(^|\b)(canary\.|ptb\.)(discord.com)$/, "$1$3");
|
||||
},
|
||||
});
|
||||
|
|
@ -72,7 +72,7 @@ export default definePlugin({
|
|||
|
||||
patches: [
|
||||
{
|
||||
find: '"private-channels-".concat(',
|
||||
find: '"dm-quick-launcher"===',
|
||||
replacement: [
|
||||
{
|
||||
// Filter out pinned channels from the private channel list
|
||||
|
|
@ -87,15 +87,15 @@ export default definePlugin({
|
|||
|
||||
// Rendering
|
||||
{
|
||||
match: /"renderRow",(\i)=>{(?<="renderDM",.+?(\i\.\i),\{channel:.+?)/,
|
||||
match: /renderRow(?:",|=)(\i)=>{(?<=renderDM(?:",|=).+?(\i\.\i),\{channel:.+?)/,
|
||||
replace: "$&if($self.isChannelIndex($1.section, $1.row))return $self.renderChannel($1.section,$1.row,$2)();"
|
||||
},
|
||||
{
|
||||
match: /"renderSection",(\i)=>{/,
|
||||
match: /renderSection(?:",|=)(\i)=>{/,
|
||||
replace: "$&if($self.isCategoryIndex($1.section))return $self.renderCategory($1);"
|
||||
},
|
||||
{
|
||||
match: /"renderSection".{0,300}?"span",{/,
|
||||
match: /renderSection(?:",|=).{0,300}?"span",{/,
|
||||
replace: "$&...$self.makeSpanProps(),"
|
||||
},
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ export default definePlugin({
|
|||
replace: "$1($2-$self.categoryLen())"
|
||||
},
|
||||
{
|
||||
match: /"getRowHeight",\((\i),(\i)\)=>{/,
|
||||
match: /getRowHeight(?:",|=)\((\i),(\i)\)=>{/,
|
||||
replace: "$&if($self.isChannelHidden($1,$2))return 0;"
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export interface Session {
|
|||
const SessionsStore = findStoreLazy("SessionsStore") as {
|
||||
getSessions(): Record<string, Session>;
|
||||
};
|
||||
const { useStatusFillColor } = mapMangledModuleLazy(".concat(.5625*", {
|
||||
const { useStatusFillColor } = mapMangledModuleLazy([".5625*", "translate"], {
|
||||
useStatusFillColor: filters.byCode(".hex")
|
||||
});
|
||||
|
||||
|
|
@ -236,8 +236,8 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Fix sizes for mobile indicators which aren't online
|
||||
match: /(?<=\(\i\.status,)(\i)(?=,(\i),\i\))/,
|
||||
replace: (_, userStatus, isMobile) => `${isMobile}?"online":${userStatus}`
|
||||
match: /(?<=\(\i\.status,)(\i)(?=,\{.{0,15}isMobile:(\i))/,
|
||||
replace: '$2?"online":$1'
|
||||
},
|
||||
{
|
||||
// Make isMobile true no matter the status
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default definePlugin({
|
|||
{
|
||||
find: ".removeObscurity,",
|
||||
replacement: {
|
||||
match: /(?<="removeObscurity",(\i)=>{)/,
|
||||
match: /(?<=removeObscurity(?:",|=)(\i)=>{)/,
|
||||
replace: (_, event) => `$self.reveal(${event});`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const Transforms = findByPropsLazy("insertNodes", "textToText");
|
|||
const Editor = findByPropsLazy("start", "end", "toSlateRange");
|
||||
const ChatInputTypes = findByPropsLazy("FORM", "USER_PROFILE");
|
||||
const InputComponent = findComponentByCodeLazy("editorClassName", "CHANNEL_TEXT_AREA");
|
||||
const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT])", "fromServer)");
|
||||
const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT]", "fromServer)");
|
||||
|
||||
interface UserProps {
|
||||
discordId: string;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export default definePlugin({
|
|||
// Slate
|
||||
{
|
||||
// Same find as FullUserInChatbox
|
||||
find: ':"text":',
|
||||
find: '"text":"locked"',
|
||||
replacement: [
|
||||
{
|
||||
match: /let\{id:(\i),guildId:\i,channelId:(\i)[^}]*\}.*?\.\i,{(?=children)/,
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export default definePlugin({
|
|||
all: true,
|
||||
// Render null instead of the buttons if the channel is hidden
|
||||
replacement: {
|
||||
match: /(?<="renderOpenChatButton",\(\)=>{)/,
|
||||
match: /(?<=renderOpenChatButton(?:",|=)\(\)=>{)/,
|
||||
replace: "if($self.isHiddenChannel(this.props.channel))return null;"
|
||||
}
|
||||
},
|
||||
|
|
@ -200,7 +200,7 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Hide the new version of unreads box for hidden channels
|
||||
find: '"ChannelListUnreadsStore",',
|
||||
find: '"ChannelListUnreadsStore"',
|
||||
replacement: {
|
||||
match: /(?<=\.id\)\))(?=&&\(0,\i\.\i\)\((\i)\))/,
|
||||
replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`
|
||||
|
|
@ -227,19 +227,19 @@ export default definePlugin({
|
|||
find: "Missing channel in Channel.renderHeaderToolbar",
|
||||
replacement: [
|
||||
{
|
||||
match: /"renderHeaderToolbar",\(\)=>{.+?case \i\.\i\.GUILD_TEXT:(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,
|
||||
match: /renderHeaderToolbar(?:",|=)\(\)=>{.+?case \i\.\i\.GUILD_TEXT:(?=.+?(\i\.push.{0,50}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,
|
||||
replace: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`
|
||||
},
|
||||
{
|
||||
match: /"renderHeaderToolbar",\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,
|
||||
match: /renderHeaderToolbar(?:",|=)\(\)=>{.+?case \i\.\i\.GUILD_MEDIA:(?=.+?(\i\.push.{0,40}channel:(\i)},"notifications"\)\)))(?<=isLurking:(\i).+?)/,
|
||||
replace: (m, pushNotificationButtonExpression, channel, isLurking) => `${m}if(!${isLurking}&&$self.isHiddenChannel(${channel})){${pushNotificationButtonExpression};break;}`
|
||||
},
|
||||
{
|
||||
match: /"renderMobileToolbar",\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/,
|
||||
match: /renderMobileToolbar(?:",|=)\(\)=>{.+?case \i\.\i\.GUILD_DIRECTORY:(?<=let{channel:(\i).+?)/,
|
||||
replace: (m, channel) => `${m}if($self.isHiddenChannel(${channel}))break;`
|
||||
},
|
||||
{
|
||||
match: /(?<="renderHeaderBar",\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/,
|
||||
match: /(?<=renderHeaderBar(?:",|=)\(\)=>{.+?hideSearch:(\i)\.isDirectory\(\))/,
|
||||
replace: (_, channel) => `||$self.isHiddenChannel(${channel})`
|
||||
},
|
||||
{
|
||||
|
|
@ -335,6 +335,13 @@ export default definePlugin({
|
|||
match: /(?<="\+"\.concat\()\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
|
||||
match: /(?<=`\+\$\{)\i(?=\})/,
|
||||
replace: overflowTextAmount => "" +
|
||||
`$self.isHiddenChannel(typeof shcChannel!=="undefined"?shcChannel:void 0,true)&&(${overflowTextAmount}-1)<=0?"":${overflowTextAmount}`
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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\)/,
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default definePlugin({
|
|||
},
|
||||
},
|
||||
{
|
||||
find: '"displayName","SpotifyStore")',
|
||||
find: "}getPlayableComputerDevices(){",
|
||||
replacement: [
|
||||
{
|
||||
predicate: () => settings.store.noSpotifyAutoPause,
|
||||
|
|
|
|||
|
|
@ -40,10 +40,16 @@ export default definePlugin({
|
|||
// popout profiles
|
||||
{
|
||||
find: "#{intl::LABEL_WITH_ONLINE_STATUS}",
|
||||
replacement: {
|
||||
match: /src:null!=\i\?(\i).{1,50}"aria-hidden":!0/,
|
||||
replace: "$&,style:$self.getAvatarStyles($1)"
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /src:null!=\i\?(\i).{1,50}"aria-hidden":!0/,
|
||||
replace: "$&,style:$self.getAvatarStyles($1)"
|
||||
},
|
||||
{
|
||||
match: /src:(\i)\?\?void 0.{1,50}"aria-hidden":!0/,
|
||||
replace: "$&,style:$self.getAvatarStyles($1)"
|
||||
}
|
||||
]
|
||||
},
|
||||
// chat avatars
|
||||
{
|
||||
|
|
|
|||
|
|
@ -111,7 +111,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\})/,
|
||||
match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,\.\.\.\i\})/,
|
||||
replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
// Add next to username (compact mode)
|
||||
match: /className:\i\(\)\(\i\.className(?:,\i\.clickable)?,\i\)}\)\),(?=\i)/g,
|
||||
match: /className:\i\(\)\(\i\.className(?:,\i\.\i)?,\i\)\}\)(?:\))?,(?=\i)/g,
|
||||
replace: "$&$self.CompactPronounsChatComponentWrapper(arguments[0]),",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ export default definePlugin({
|
|||
settings,
|
||||
patches: [
|
||||
{
|
||||
find: '.banner)==null?"COMPLETE"',
|
||||
find: ':"SHOULD_LOAD");',
|
||||
replacement: {
|
||||
match: /(?<=void 0:)\i.getPreviewBanner\(\i,\i,\i\)/,
|
||||
match: /\i(?:\?)?.getPreviewBanner\(\i,\i,\i\)(?=.{0,100}"COMPLETE")/,
|
||||
replace: "$self.patchBannerUrl(arguments[0])||$&"
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,10 +44,16 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
find: "ReferencedMessageStore",
|
||||
replacement: {
|
||||
match: /constructor\(\)\{\i\(this,"_channelCaches",new Map\)/,
|
||||
replace: "$&;$self.setReplyStore(this);"
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /constructor\(\)\{\i\(this,"_channelCaches",new Map\)/,
|
||||
replace: "$&;$self.setReplyStore(this);"
|
||||
},
|
||||
{
|
||||
match: /_channelCaches=new Map;/,
|
||||
replace: "$&_=$self.setReplyStore(this);"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -206,10 +206,16 @@ export default definePlugin({
|
|||
// Banners
|
||||
{
|
||||
find: 'backgroundColor:"COMPLETE"',
|
||||
replacement: {
|
||||
match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\2,)/,
|
||||
replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
|
||||
}
|
||||
replacement: [
|
||||
{
|
||||
match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\2,)/,
|
||||
replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
|
||||
},
|
||||
{
|
||||
match: /(overflow:"visible",.{0,125}?!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?`url\(\$\{\2\}\))/,
|
||||
replace: (_, rest, bannerSrc) => `${rest}onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
|
||||
}
|
||||
]
|
||||
},
|
||||
// Group DMs top small & large icon
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import { saveFile } from "@utils/web";
|
|||
import { filters, mapMangledModuleLazy } from "@webpack";
|
||||
import { ComponentDispatch } from "@webpack/common";
|
||||
|
||||
const ctxMenuCallbacks = mapMangledModuleLazy('.tagName)==="TEXTAREA"||', {
|
||||
contextMenuCallbackWeb: filters.byCode('.tagName)==="INPUT"||'),
|
||||
contextMenuCallbackNative: filters.byCode('.tagName)==="TEXTAREA"||')
|
||||
const ctxMenuCallbacks = mapMangledModuleLazy('closest("[contenteditable=true]")', {
|
||||
contextMenuCallbackWeb: filters.byCode('"[contenteditable=true]"'),
|
||||
contextMenuCallbackNative: filters.byCode('.getPropertyValue("-webkit-user-select")')
|
||||
});
|
||||
|
||||
async function fetchImage(url: string) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export default definePlugin({
|
|||
break;
|
||||
case ",":
|
||||
e.preventDefault();
|
||||
SettingsRouter.open("My Account");
|
||||
SettingsRouter.openUserSettings("my_account_panel");
|
||||
break;
|
||||
default:
|
||||
if (e.key >= "1" && e.key <= "9") {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ export default definePlugin({
|
|||
match: /"x-google-max-bitrate=".concat\(\i\)/,
|
||||
replace: '"x-google-max-bitrate=".concat("80_000")'
|
||||
},
|
||||
{
|
||||
match: /`x-google-max-bitrate=\$\{\i\}`/,
|
||||
replace: '"x-google-max-bitrate=80_000"'
|
||||
},
|
||||
{
|
||||
match: ";level-asymmetry-allowed=1",
|
||||
replace: ";b=AS:800000;level-asymmetry-allowed=1"
|
||||
|
|
@ -28,7 +32,11 @@ export default definePlugin({
|
|||
{
|
||||
match: /;usedtx=".concat\((\i)\?"0":"1"\)/,
|
||||
replace: '$&.concat($1?";stereo=1;sprop-stereo=1":"")'
|
||||
}
|
||||
},
|
||||
{
|
||||
match: /;usedtx=\$\{(\i)\?"0":"1"\}/,
|
||||
replace: '$&${$1?";stereo=1;sprop-stereo=1":""}'
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ export default definePlugin({
|
|||
|
||||
find: "cleanAutomaticAnchor(){",
|
||||
replacement: {
|
||||
match: /constructor\(\i\)\{(?=.{0,100}automaticAnchor)/,
|
||||
match: /constructor\(\i\)\{(?=.{0,100}(?:automaticAnchor|\.messages\.loadingMore))/,
|
||||
replace: "$&$self.setScrollObj(this);"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ waitFor(m => {
|
|||
}
|
||||
|
||||
const str = String(m);
|
||||
return str.includes(".resolve({theme:null") && !str.includes("useMemo");
|
||||
return str.includes(".resolve({theme:") && str.includes('"refresh-fast-follow-avatars"') && !str.includes("useMemo");
|
||||
}, m => useToken = m);
|
||||
|
||||
export const MaskedLink = waitForComponent<t.MaskedLink>("MaskedLink", filters.componentByCode("MASKED_LINK)"));
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export const UploadHandler = {
|
|||
|
||||
export const ApplicationAssetUtils = mapMangledModuleLazy("getAssetImage: size must === [", {
|
||||
fetchAssetIds: filters.byCode('.startsWith("http:")', ".dispatch({"),
|
||||
getAssetFromImageURL: filters.byCode("].serialize(", ',":"'),
|
||||
getAssetFromImageURL: filters.byCode("].serialize(", ":null"),
|
||||
getAssetImage: filters.byCode("getAssetImage: size must === ["),
|
||||
getAssets: filters.byCode(".assets")
|
||||
});
|
||||
|
|
@ -160,7 +160,7 @@ export const ChannelRouter: t.ChannelRouter = mapMangledModuleLazy('"Thread must
|
|||
});
|
||||
|
||||
export let SettingsRouter: any;
|
||||
waitFor(["open", "saveAccountChanges"], m => SettingsRouter = m);
|
||||
waitFor(["openUserSettings", "USER_SETTINGS_MODAL_KEY"], m => SettingsRouter = m);
|
||||
|
||||
export const PermissionsBits: t.PermissionsBits = findLazy(m => typeof m.ADMINISTRATOR === "bigint");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue