Fix Our Plugins

This commit is contained in:
thororen1234 2026-01-23 11:49:39 -05:00
parent 042e4f8b85
commit ce487d6ef8
No known key found for this signature in database
30 changed files with 107 additions and 95 deletions

View file

@ -35,8 +35,8 @@ export default definePlugin({
replace: "let [searchResults,setSearchResults]=$2.useState([]);$self.setUpdateFunc($1,setSearchResults);"
},
{
match: /(usersList,children:)(\i)/,
replace: "$1(searchResults.length?searchResults:$2)"
match: /(?<=\i,children:)(\i)(?=\.slice)/,
replace: "(searchResults.length?searchResults:$1)"
},
]
}

View file

@ -37,20 +37,20 @@ export default definePlugin({
authors: [EquicordDevs.iamme, Devs.thororen],
patches: [
{
find: ".hideDetailsButtonContainer,",
find: "#{intl::xdCLeM::raw}",
replacement: [
{
match: /banner\}\),.{0,25}profile:\i\}\),.{0,15}profile:\i/,
match: /profile:\i\}\),.{0,15}profile:\i/,
replace: "$&,invite:arguments[0].invite"
}
]
},
{
find: ".guildNameContainer,onClick:",
find: "onlineCount})})]",
replacement: [
{
// make the button clickable
match: /children:(\i)\.name\}\).{0,100}\.guildNameContainer/,
match: /children:(\i)\.name\}\)\}\)\}\)/,
replace: "onClick:$self.Lurkable($1),$&"
},
{

View file

@ -65,12 +65,12 @@ export default definePlugin({
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
replacement: [
{
match: /className:\i\.micButtonWithMenu,/g,
match: /(?<=#{intl::MUTE}\),)className:\i\.\i,/g,
replace: ""
},
{
// TODO: MAKE THIS BETTER
match: /,\(0,\i\.jsxs?\).{0,130}\.buttonChevron.{0,530}\}\)(?=\])/g,
match: /,\(0,\i\.jsxs?\).{0,130}#{intl::18wnuD::raw}.{0,530}\}\)(?=\])/g,
replace: ""
}
],

View file

@ -46,7 +46,7 @@ export default definePlugin({
},
// Threads
{
find: "spineWithGuildIcon]:",
find: "18V16H9v2H6Zm3",
replacement: {
match: /mentionsCount:\i.+?null(?<=channel:(\i).+?)/,
replace: "$&,$self.renderChannelBadges($1)"

View file

@ -61,7 +61,7 @@ export default definePlugin({
find: '"AppView"',
replacement: [
{
match: /(\?void 0:(\i)\.channelId.{0,600})"div",{(?=className:\i\.content)/,
match: /(\?void 0:(\i)\.channelId.{0,600})"div",{(?=className:\i\.\i)/,
replace: "$1$self.render,{currentChannel:$2,",
predicate: () => settings.store.tabBarPosition === "top"
},
@ -82,17 +82,17 @@ export default definePlugin({
},
// ctrl click to open in new tab in inbox unread
{
find: ".messageContainer,onKeyDown",
find: '[data-recents-channel="',
replacement: {
match: /.jumpButton,onJump:\i=>(\i)\(\i,(\i)\.id\)/,
replace: ".jumpButton,onJump: event => { if (event.ctrlKey) $self.open($2); else $1(event, $2.id) }"
match: /(?<=className:\i.\i,onJump:)\i=>(\i)\(\i,(\i)\.id\)/,
replace: "event => { if (event.ctrlKey) $self.open($2); else $1(event, $2.id) }"
}
},
// ctrl click to open in new tab in inbox mentions
{
find: ".deleteRecentMention(",
replacement: {
match: /(?<=.jumpMessageButton,onJump:)(\i)(?=.{0,20}message:(\i))/,
match: /(?<=className:\i.\i,onJump:)(\i)(?=.{0,20}message:(\i))/,
replace: "event => { if (event.ctrlKey) $self.open($2); else $1(event) }"
}
},
@ -106,7 +106,7 @@ export default definePlugin({
},
// prevent issues with the pins/inbox popouts being too tall
{
find: ".messagesPopoutWrap),style",
find: "renderCloseButton()",
replacement: {
match: /\i&&\((\i).maxHeight.{0,5}\)/,
replace: "$&;$1.maxHeight-=$self.containerHeight"

View file

@ -152,7 +152,7 @@ export default definePlugin({
patches: [
// message
{
find: ".messageListItem",
find: ".NITRO_NOTIFICATION,[",
replacement: {
match: /renderContentOnly:\i}=\i;/,
replace: "$&if($self.shouldHideUser(arguments[0].message.author.id, arguments[0].message.channel_id)) return null; "

View file

@ -230,7 +230,7 @@ export default definePlugin({
{
find: '"sticker")',
replacement: {
match: /(\.buttons,.{0,50}children:)(.+?)\}/,
match: /(\(\)\(\i\.\i,.{0,50}children:)(.+?)\}/,
replace: "$1$self.wrapChatBarChildren($2)}"
}
}

View file

@ -18,7 +18,7 @@ export default definePlugin({
settings,
patches: [
{
find: ".folderButtonInner",
find: "#{intl::GUILD_FOLDER_TOOLTIP_A11Y_LABEL}",
replacement: {
match: /(\(0,\i\.jsx\)\(\i,\{folderNode:(\i),hovered:\i,sorting:\i\}\))/,
replace: "($self.shouldReplace({folderNode:$2})?$self.replace({folderNode:$2}):$1)"

View file

@ -124,7 +124,7 @@ export default definePlugin({
{
find: "PrivateChannel.renderAvatar",
replacement: {
match: /(withDisplayNameStyles\]:\i\}\),children:\i\}\),)/,
match: /(\i\]:\i\}\),children:\i\}\),)(?=.{0,25}isSystemDM\(\))/,
replace: "$1style:{color:`${$self.colorDMList(arguments[0])}`},"
},
predicate: () => settings.store.dmList,
@ -137,7 +137,7 @@ export default definePlugin({
replace: ",style$1"
},
{
match: /(?<=nameAndDecorators,)/,
match: /(?<="div",\{className:\i\.\i,)(?=children:\[)/,
replace: "style:style||{},"
},
],

View file

@ -18,7 +18,7 @@ export default definePlugin({
settings,
patches: [
{
find: ".devBanner,",
find: '"isHideDevBanner"',
replacement: [
{
match: '"staging"===window.GLOBAL_ENV.RELEASE_CHANNEL',

View file

@ -54,7 +54,7 @@ export default definePlugin({
replace: "$1arguments[0]?.collected?.isDragging?$self.dragItem():$2",
},
{
match: /\[(\i\.emojiItemSelected)\]/,
match: /\[(\i\.\i)\](?=.{0,5}\[null!=)/,
replace: '[arguments[0].collected.isDragging?"":$1]',
},
{

View file

@ -88,19 +88,19 @@ export default definePlugin({
},
// Popout camera when not focused on voice channel
{
find: ".mirror]:",
find: "this.handleReady})",
all: true,
predicate: () => settings.store.noMirroredCamera,
replacement: {
match: /\[(\i).mirror]:\i/,
replace: "[$1.mirror]:!1"
match: /(\[\i\.\i\]:)\i/,
replace: "$1!1"
},
},
// Overriding css on Preview Camera/Change Video Background popup
{
find: ".cameraPreview,",
find: ".PREVIEW_CAMERA_MODAL,",
replacement: {
match: /className:\i.camera,/,
match: /className:\i.\i,(?=children:\()/,
replace: "$&style:{transform: \"scalex(1)\"},"
},
predicate: () => settings.store.noMirroredCamera
@ -146,7 +146,7 @@ export default definePlugin({
find: "Message Username",
predicate: () => settings.store.forceRoleIcon,
replacement: {
match: /(?<=\.badgesContainer.{0,150}\?2:)0(?=\})/,
match: /(?<=\}\):null\].{0,150}\?2:)0(?=\})/,
replace: "1"
}
},

View file

@ -88,7 +88,7 @@ export default definePlugin({
},
// Threads
{
find: "spineWithGuildIcon]:",
find: "18V16H9v2H6Zm3",
replacement: {
match: /mentionsCount:\i.+?null(?<=channel:(\i).+?)/,
replace: "$&,$self.TrashIcon($1)"

View file

@ -152,9 +152,9 @@ export default definePlugin({
patches: [
{
find: "interactiveSelected]",
find: "PrivateChannel.renderAvatar",
replacement: {
match: /interactiveSelected.{0,50}children:\[/,
match: /\]:\i\|\|\i.{0,50}children:\[/,
replace: "$&$self.renderBoo(arguments[0]),"
}
},

View file

@ -315,7 +315,7 @@ export default definePlugin({
replace: "$1;$self.insertCollections(this);$2"
},
{
match: /(className:\w\.categoryName,children:)(\i)/,
match: /("span",\{className:\i\.\i,children:)(\i)/,
replace: "$1$self.hidePrefix($2),"
},
]

View file

@ -92,19 +92,11 @@ export default definePlugin({
replace: "$&,$self.ProfilePopoutComponent(arguments[0])"
}
},
// User Profile Modal v1
{
find: ".connections,userId:",
replacement: {
match: /user:(\i).{0,15}displayProfile:(\i).*?application\.id\)\)\}\)/,
replace: "$&,$self.ProfilePopoutComponent(arguments[0]),"
}
},
// User Profile Modal v2
{
find: ".MODAL_V2,onClose:",
replacement: {
match: /displayProfile:(\i).*?profileAppConnections\}\)\}\)/,
match: /displayProfile:(\i).*?connections:\i.{0,25}\i.\i\}\)\}\)/,
replace: "$&,$self.ProfilePopoutComponent({ user: arguments[0].user, displayProfile: $1 }),",
predicate: () => !settings.store.showRepositoryTab,
}

View file

@ -81,8 +81,8 @@ export default definePlugin({
{
find: '"sticker")',
replacement: {
match: /(.buttons,.{0,50}children:)(.+?)\}/,
replace: "$1$self.buttonsInner($2)}"
match: /(?<=\(\)\(\i\.\i,.{0,50}children:)(.+?)\}/,
replace: "$self.buttonsInner($2)}"
}
}
],

View file

@ -89,7 +89,7 @@ export default definePlugin({
{
find: "#{intl::INCOMING_CALL_ELLIPSIS}",
replacement: {
match: /actionButton\}\)/,
match: /\(\i\)\)\),className:\i\.\i\}\)/,
replace: "$&,$self.renderIgnore(arguments[0].channel)"
}
}

View file

@ -49,9 +49,33 @@ export default definePlugin({
name: "MediaPlaybackSpeed",
description: "Allows changing the (default) playback speed of media embeds",
authors: [Devs.D3SOX],
settings,
patches: [
// replace voice message embed speed control because ours provides more speeds
{
find: "\"--:--\"",
replacement: {
match: /\(0,\i\.jsxs?\)\(.{0,50}\.\i,onClick:\(\).+?\}\)\}\)(?<=playbackCacheKey:\i\}=\i,(\i).+?)/,
replace: "$self.renderPlaybackSpeedComponent({mediaRef:$1})"
}
},
// audio & video embeds
{
// need to pass media ref via props to make it easily accessible from inside controls
find: "renderControls(){",
replacement: {
match: /onToggleMuted:this.toggleMuted,/,
replace: "$&mediaRef:this.mediaRef,"
}
},
{
find: "AUDIO:\"AUDIO\"",
replacement: {
match: /sliderWrapperClassName:\i.\i\}\)\}\),/,
replace: "$&$self.renderPlaybackSpeedComponent({mediaRef:this?.props?.mediaRef}),"
}
}
],
renderPlaybackSpeedComponent: ErrorBoundary.wrap(({ mediaRef }: { mediaRef: MediaRef; }) => {
const changeSpeed = (speed: number) => {
const media = mediaRef?.current;
@ -109,32 +133,5 @@ export default definePlugin({
)}
</Tooltip>
);
}),
patches: [
// replace voice message embed speed control because ours provides more speeds
{
find: "\"--:--\"",
replacement: {
match: /\(0,\i\.jsxs?\)\(.{0,50}\.playbackRateContainer.+?}\)}\)(?<=playbackCacheKey:\i\}=\i,(\i).+?)/,
replace: "$self.renderPlaybackSpeedComponent({mediaRef:$1})"
}
},
// audio & video embeds
{
// need to pass media ref via props to make it easily accessible from inside controls
find: "renderControls(){",
replacement: {
match: /onToggleMuted:this.toggleMuted,/,
replace: "$&mediaRef:this.mediaRef,"
}
},
{
find: "AUDIO:\"AUDIO\"",
replacement: {
match: /\i.volumeSliderWrapper\}\)\}\),/,
replace: "$&$self.renderPlaybackSpeedComponent({mediaRef:this?.props?.mediaRef}),"
}
}
]
})
});

View file

@ -68,7 +68,7 @@ export default definePlugin({
patches: [
{
find: ',className:"channelMention",children:[',
find: '"channelMention",children:[null',
replacement: {
match: /(?<=\.jsxs\)\()(\i\.\i),\{(?=role:"link")/,
replace: "$self.MentionTooltip,{Component:$1,vcProps:arguments[0],"
@ -79,7 +79,7 @@ export default definePlugin({
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
replacement: {
// Should match two places
match: /(\i\.\i),\{(?=className:\i\(\)\(\i\.repliedTextPreview,\i\.clickable)/g,
match: /(\i\.\i),\{(?=className:\i\(\)\(\i\.\i,\i\.\i)/g,
replace: "$self.ReplyTooltip,{Component:$1,vcProps:arguments[0],"
},
predicate: () => settings.store.onReply,
@ -87,7 +87,7 @@ export default definePlugin({
{
find: "#{intl::MESSAGE_FORWARDED}",
replacement: {
match: /(\i\.\i),\{(?=className:\i\.footerContainer)/g,
match: /(\i\.\i),\{(?=className:\i\.\i,onClick:\i)/g,
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
},
predicate: () => settings.store.onForward,

View file

@ -270,7 +270,7 @@ export default definePlugin({
{
find: "childrenMessageContent:null",
replacement: {
match: /(cozyMessage.{1,50},)childrenHeader:/,
match: /(\i\]:!\i.{1,50},)childrenHeader:/,
replace: "$1childrenAccessories:arguments[0].childrenAccessories || null,childrenHeader:"
}
},

View file

@ -34,9 +34,9 @@ export default definePlugin({
patches: [
{
find: ".stickerButton)},",
find: "#{intl::STICKER_BUTTON_LABEL}",
replacement: [{
match: /(children:\(0,\i\.jsx\)\()(.{0,10})({(className|innerClassName).{10,30}\.stickerButton)/,
match: /(children:\(0,\i\.jsx\)\()(.{0,10})({className:\i\(\)\(\i\.\i,\i\.\i)/,
replace: "$1arguments[0]?.stickersType?$self.stickerButton:$2$3"
}, {
match: /(\i=)((\i\.useCallback\(\(\)=>\{\(.*?\)\().*?\.STICKER,(\i.{0,25}\]\)))/,
@ -63,7 +63,7 @@ export default definePlugin({
find: "#{intl::EXPRESSION_PICKER_CATEGORIES_A11Y_LABEL}",
replacement: [
{
match: /(?<=(\i)\?(\(.{0,15}\))\((\i),\{.{0,150}(\i)===\i\.\i\.STICKER,.{0,150}children:(.{0,30}\.stickersNavItem,children:.{0,25})\}\)\}\):null)/,
match: /(?<=(\i)\?(\(.{0,15}\))\((\i),\{.{0,150}(\i)===\i\.\i\.STICKER,.{0,150}children:(.{0,30}\.\i,children:.{0,25})\}\)\}\):null)/,
replace: ',vcStickers=$1?$2($3,{id:"stickers+-picker-tab","aria-controls":"more-stickers-picker-tab-panel","aria-selected":$4==="stickers+",isActive:$4==="stickers+",autoFocus:true,viewType:"stickers+",children:$5+"+"})}):null'
},
{

View file

@ -52,7 +52,7 @@ export default definePlugin({
patches: [
{
find: "this.isCopiedStreakGodlike",
find: "NITRO_PRIVACY_PERK_BETA_COACHMARK));",
replacement: {
// react.jsx)(AccountPanel, { ..., showTaglessAccountPanel: blah })
match: /(?<=\i\.jsxs?\)\()(\i),{(?=[^}]*?userTag:\i,hidePrivateData:)/,

View file

@ -64,7 +64,7 @@ export default definePlugin({
}
},
{
find: "voiceChannelEffect]:",
find: "#{intl::POPOUT_STAY_ON_TOP}),icon:",
replacement: {
match: /(?<=CallTile.{0,15}\.memo\((\i)=>\{)/,
replace: "$1.platform = $self.getPlatform(false, $1?.participantUserId)?.vcIcon || $1?.platform;"

View file

@ -266,7 +266,7 @@ export default definePlugin({
{
find: 'backgroundColor:"COMPLETE"',
replacement: {
match: /(?<=backgroundImage.+?children:)!\i.{0,100}gifTag\}\)/,
match: /(?<=backgroundImage.+?children:)!\i.{0,100}className:\i\.\i\}\)/,
replace: "[$self.renderProfileTimezone(arguments[0]),$&]"
}
},

View file

@ -36,11 +36,34 @@ export default definePlugin({
settings,
patches: [
{
find: "multiaccount_cta_tooltip_seen",
replacement: {
match: /(let \i=)\d+(,\i="switch-accounts-modal")/,
replace: "$1$self.getMaxAccounts()$2",
},
find: "pushSyncToken:null",
replacement: [
{
match: /(\).length>)5/,
replace: "$1$self.getMaxAccounts()",
},
{
match: /(\i.splice\()5/,
replace: "$1$self.getMaxAccounts()",
},
]
},
{
find: "getCurrentUser(),multiAccountUsers",
replacement: [
{
match: /(maxNumAccounts:)5/,
replace: "$1$self.getMaxAccounts()",
},
{
match: /(\i.length<)5/,
replace: "$1$self.getMaxAccounts()",
},
{
match: /(\i.length>=)5/,
replace: "$1$self.getMaxAccounts()",
},
]
},
],
getMaxAccounts() { return settings.store.maxAccounts === 0 ? Infinity : settings.store.maxAccounts; },

View file

@ -20,10 +20,10 @@ export default definePlugin({
settings,
patches: [
{
find: "\"avatarContainerClass\",\"userNameClassName\"",
find: ".VOICE_PANEL}};",
replacement: [
{
match: /flipped\]:\i\}\),children:\[/,
match: /\[\i\.\i\]:\i\}\),children:\[/,
replace: "$&$self.renderButtons(arguments[0].user),"
}
]

View file

@ -316,7 +316,7 @@ export default definePlugin({
description: "On-device transcriptions for voice messages powered by Whisper v3",
patches: [
{
find: ".volumeButtonIcon,",
find: ".VOICE_MESSAGE)),",
replacement: {
match: /"source",{src:(\i).{0,700}duration:\i}\),/,
replace: "$&$self.button($1),"

View file

@ -88,8 +88,8 @@ export default definePlugin({
},
// Add a custom class to identify the quick reactions have been modified and a CSS variable for the number of columns to display
{
match: /className:(\i)\.wrapper,/,
replace: "className:\"vc-better-quick-react \"+($self.settings.store.compactMode?\"vc-better-quick-react-compact \":\"\")+$1.wrapper,style:{\"--vc-better-quick-react-columns\":$self.settings.store.columns},"
match: /className:(\i\.\i),(?=children:)/,
replace: "className:\"vc-better-quick-react \"+($self.settings.store.compactMode?\"vc-better-quick-react-compact \":\"\")+$1,style:{\"--vc-better-quick-react-columns\":$self.settings.store.columns},"
},
// Scroll handler + Apply the emoji count limit from earlier with custom logic
{

View file

@ -70,7 +70,7 @@ export default definePlugin({
find: "#{intl::FRIEND_REQUEST_CANCEL}",
replacement: {
predicate: () => settings.store.showDates,
match: /(?<=\.listItemContents,children:\[)\(0,.+?(?=,\(0)(?<=user:(\i).+?)/,
match: /(?<=\.\i,children:\[)\(0,.+?(?=,\(0)(?<=user:(\i).+?)/,
replace: (children, user) => `$self.WrapperDateComponent({user:${user},children:${children}})`
}
},