Merge branch 'pr-3966' into dev

This commit is contained in:
thororen1234 2026-02-05 01:34:05 -05:00
commit 71c1cebb17
No known key found for this signature in database
37 changed files with 166 additions and 94 deletions

View file

@ -51,11 +51,17 @@ export default definePlugin({
// Show plugin name instead of "Built-In"
{
find: "#{intl::COMMANDS_OPTIONAL_COUNT}",
replacement: {
// ...children: p?.name
match: /(?<=:(\i)\.displayDescription\}.{0,200}children:).{0,50}\.name(?=\}\))/,
replace: "$1.plugin||($&)"
}
replacement: [
{
// ...children: p?.name
match: /(?<=:(\i)\.displayDescription\}.{0,200}children:).{0,50}\.name(?=\}\))/,
replace: "$1.plugin||($&)"
},
{
match: /children:(?=\i\?\?\i\?\.name)(?<=command:(\i),.+?)/,
replace: "children:$1.plugin??"
}
]
}
],
});

View file

@ -13,7 +13,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)/,

View file

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

View file

@ -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: ""

View file

@ -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:

View file

@ -25,11 +25,17 @@ export default definePlugin({
settings,
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"'
}
]
},
{
find: "#{intl::NO_GIF_FAVORITES_HOW_TO_FAVORITE}",

View file

@ -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")
});
}

View file

@ -49,7 +49,7 @@ export default definePlugin({
patches: [
{
find: "}renderEmbeds(",
find: "}renderStickersAccessories(",
replacement: [
{
match: /(\.renderReactions\(\i\).+?className:)/,

View file

@ -148,10 +148,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."',
@ -162,10 +168,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",
@ -183,17 +195,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
{

View file

@ -249,11 +249,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})"
}
]
}
],

View file

@ -227,7 +227,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"

View file

@ -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"
}
]
})),

View file

@ -299,13 +299,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,.{0,15}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

View file

@ -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 &&

View file

@ -162,7 +162,7 @@ export default definePlugin({
patches: [
{
find: ".renderLinkComponent)?",
find: "disableArrowKeySeek:!0",
replacement: [
{
match: /useFullWidth:!0,shouldLink:/,

View file

@ -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
}

View file

@ -52,10 +52,16 @@ export default definePlugin({
patches: [{
// HEY THOR UPDATE SHOW ME YOUR NAME IF THIS SHIT CHANGES TY :)
find: ".USER_MENTION)",
replacement: {
match: /"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/,
replace: "$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})"
}
replacement: [
{
match: /children:"@"\.concat\((null!=\i\?\i:\i)\)(?<=\.useName\((\i)\).+?)/,
replace: "children:$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})"
},
{
match: /children:`@\$\{(\i\?\?\i)\}`(?<=\.useName\((\i)\).+?)/,
replace: "children:$self.renderUsername({username:$1,user:$2,showMeYourNameMention:typeof showMeYourNameMention!=='undefined'?showMeYourNameMention:undefined})"
}
]
},
{
find: ".ROLE_MENTION)",

View file

@ -715,7 +715,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

View file

@ -15,8 +15,8 @@ export default definePlugin({
{
find: "#{intl::COPY_MESSAGE_LINK}",
replacement: {
match: /\.concat\(location\.host\)/,
replace: ".concat($self.normalizeHost(location.host))",
match: /(?<=(?:.concat\(|\/\/\$\{))location\.host/,
replace: "$self.normalizeHost(location.host)",
},
},
],

View file

@ -26,7 +26,8 @@ interface ColorPickerWithSwatchesProps {
const ColorPickerWithSwatches = findComponentByCodeLazy<ColorPickerWithSwatchesProps>('id:"color-picker"');
export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}"UserSettings"/);
// 701663 this is terrible imo
export const requireSettingsMenu = extractAndLoadChunksLazy(['"AppSkeleton"'], /createPromise:.{0,20}(\i\.\i\("?.+?"?\).*?).then\(\i\.bind\(\i,"?(.+?)"?\)\).{0,50}\}\),(?=.{0,15}createPromise.*?\}\),)/);
const cl = classNameFactory("vc-pindms-modal-");

View file

@ -73,7 +73,7 @@ export default definePlugin({
patches: [
{
find: '"private-channels-".concat(',
find: '"dm-quick-launcher"===',
replacement: [
{
// Filter out pinned channels from the private channel list
@ -88,15 +88,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(),"
},
@ -106,7 +106,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;"
},

View file

@ -32,7 +32,7 @@ export default definePlugin({
{
find: ".removeObscurity,",
replacement: {
match: /(?<="removeObscurity",(\i)=>{)/,
match: /(?<=removeObscurity(?:",|=)(\i)=>{)/,
replace: (_, event) => `$self.reveal(${event});`
}
}

View file

@ -32,7 +32,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;

View file

@ -159,7 +159,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;"
}
},
@ -223,7 +223,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})`
@ -250,19 +250,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})`
},
{

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

@ -51,7 +51,7 @@ export default definePlugin({
},
},
{
find: '"displayName","SpotifyStore")',
find: "}getPlayableComputerDevices(){",
replacement: [
{
predicate: () => settings.store.noSpotifyAutoPause,

View file

@ -39,10 +39,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
{

View file

@ -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]),",
},
]

View file

@ -58,9 +58,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])||$&"
}

View file

@ -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);"
}
]
}
],

View file

@ -205,10 +205,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
{

View file

@ -24,7 +24,7 @@ import { saveFile } from "@utils/web";
import { filters, mapMangledModuleLazy } from "@webpack";
import { ComponentDispatch } from "@webpack/common";
const ctxMenuCallbacks = mapMangledModuleLazy('.tagName)==="TEXTAREA"||', {
const ctxMenuCallbacks = mapMangledModuleLazy('closest("[contenteditable=true]")', {
contextMenuCallbackWeb: filters.byCode('"[contenteditable=true]"'),
contextMenuCallbackNative: filters.byCode('.getPropertyValue("-webkit-user-select")')
});

View file

@ -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":""}'
},
]
}
]

View file

@ -110,7 +110,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);"
}
}

View file

@ -101,7 +101,8 @@ interface Modals {
}>;
}
export const Modals: Modals = mapMangledModuleLazy('??"thin")', {
// TODO: move to new modal api
export const Modals: Modals = mapMangledModuleLazy(".MODAL_ROOT_LEGACY,", {
ModalRoot: filters.componentByCode('.MODAL,"aria-labelledby":'),
ModalHeader: filters.componentByCode(",id:"),
ModalContent: filters.componentByCode("scrollbarType:"),

View file

@ -60,7 +60,7 @@ export const TextInput = waitForComponent<t.TextInput>("TextInput", filters.comp
export const TextArea = waitForComponent<t.TextArea>("TextArea", filters.componentByCode("this.getPaddingRight()},id:"));
export const Select = waitForComponent<t.Select>("Select", filters.componentByCode('"Select"'));
export const SearchableSelect = waitForComponent<t.SearchableSelect>("SearchableSelect", filters.componentByCode('"SearchableSelect"'));
export const Slider = waitForComponent<t.Slider>("Slider", filters.componentByCode("`markDash${null=="));
export const Slider = waitForComponent<t.Slider>("Slider", filters.componentByCode("markDash", "this.renderMark("));
export const Popout = waitForComponent<t.Popout>("Popout", filters.componentByCode("ref:this.ref,", "renderPopout:this.renderPopout,"));
export const Dialog = waitForComponent<t.Dialog>("Dialog", filters.componentByCode('role:"dialog",tabIndex:-1'));
export const TabBar = waitForComponent("TabBar", filters.componentByCode("ref:this.tabBarRef,className:"));
@ -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)"));

View file

@ -147,7 +147,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")
});
@ -164,7 +164,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");