Merge branch 'pr-3966' into dev

This commit is contained in:
thororen1234 2026-02-04 22:18:58 -05:00
commit bc8491522a
No known key found for this signature in database
8 changed files with 26 additions and 14 deletions

View file

@ -101,8 +101,13 @@ export default definePlugin({
find: "this.renderArtisanalHack()",
replacement: [
{ // Fade in on layer
match: /(?<=\((\i),"contextType",\i\.\i\);)/,
replace: "$1=$self.Layer;",
// class Layer {
// static contextType = ...;
// ...
// }
// class OtherClass {
match: /(static contextType=\i\.\i;.+?})(?=class)(?<=class (\i).+?)/,
replace: (_, before, Layer) => `${before};${Layer}=$self.Layer;`,
predicate: () => settings.store.disableFade
},
{ // Lazy-load contents
@ -129,8 +134,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
},

View file

@ -97,9 +97,10 @@ export default definePlugin({
},
// Enable experiment embed on sent experiment links
{
find: "`Clear Treatment ${",
find: "Clear Treatment ",
replacement: [
{
// TODO: stable compat optional chaining remove once some time has passed
match: /\i\??\.isStaff\(\)/,
replace: "true"
},

View file

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

View file

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

View file

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

View file

@ -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})`
},
{
@ -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

@ -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\})/,
match: /(?<=function \i\(\i\)\{)(?=[^}]+?\{channel:\i,isThreadCreation:\i=!1,...\i\})/,
replace: "let typingUserObjects = $self.useTypingUsers(arguments[0]?.channel);"
},
{

View file

@ -101,7 +101,7 @@ interface Modals {
}>;
}
export const Modals: Modals = mapMangledModuleLazy(':"thin")', {
export const Modals: Modals = mapMangledModuleLazy('??"thin")', {
ModalRoot: filters.componentByCode('.MODAL,"aria-labelledby":'),
ModalHeader: filters.componentByCode(",id:"),
ModalContent: filters.componentByCode("scrollbarType:"),