Merge branch 'pr-3925' into dev

This commit is contained in:
thororen1234 2026-01-23 20:00:48 -05:00
commit 6e85d45c1a
No known key found for this signature in database
23 changed files with 58 additions and 69 deletions

View file

@ -16,7 +16,7 @@ export default definePlugin({
{
find: '"sticker")',
replacement: {
match: /let (\i)=\(0,\i\.chain\).+?;(?=return 0===\1\.length)/,
match: /let (\i)=\(0,\i\.chain\).{0,150}?;(?=return 0===\1\.length)/,
replace: "$&Vencord.Api.ChatButtons._injectButtons($1,arguments[0]);"
}
}

View file

@ -13,7 +13,7 @@ export default definePlugin({
description: "Allows you to omit either width or height when opening an image modal",
patches: [
{
find: "useFullWidth:!0,shouldLink:",
find: ".renderLinkComponent)?",
replacement: {
// widthAndHeightPassed = w != null && w !== 0 && h == null || h === 0
match: /(?<=\i=)(null!=\i&&0!==\i)&&(null!=\i&&0!==\i)/,

View file

@ -133,14 +133,14 @@ export default definePlugin({
replace: "$&.replace(/^./, c => c.toUpperCase())"
},
{
match: /"text-xxs\/normal".+?(?=null!=(\i)&&(.{0,20}\i\.Text.{0,200}?,children:).{0,15}?("span"),({className:\i\.\i,children:\["Build Override: ",\1\.id\]\})\)\}\))/,
match: /"text-xxs\/normal".{0,300}?(?=null!=(\i)&&(.{0,20}\i\.Text.{0,200}?,children:).{0,15}?("span"),({className:\i\.\i,children:\["Build Override: ",\1\.id\]\})\)\}\))/,
replace: (m, _buildOverride, makeRow, component, props) => {
props = props.replace(/children:\[.+\]/, "");
return `${m},$self.makeInfoElements(${component},${props}).map(e=>${makeRow}e})),`;
}
},
{
match: /"text-xs\/normal".+?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}className:\i.\i,.+?\})\)," "/,
match: /"text-xs\/normal".{0,300}?\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}className:\i.\i,.+?\})\)," "/,
replace: (m, component, props) => {
props = props.replace(/children:\[.+\]/, "");
return `${m},$self.makeInfoElements(${component},${props})`;

View file

@ -26,7 +26,7 @@ import { CloudUpload } from "@vencord/discord-types";
import { findByCodeLazy } from "@webpack";
import { useState } from "@webpack/common";
const ActionBarIcon = findByCodeLazy(".actionBarIcon");
const ActionBarIcon = findByCodeLazy("Children.map", "isValidElement", "dangerous:");
const enum Methods {
Random,

View file

@ -53,7 +53,7 @@ export default definePlugin({
replacement: [
{
match: /(\.renderReactions\(\i\).+?className:)/,
replace: "$&(this.props.channel.nsfw || $self.settings.store.blurAllChannels ? ' vc-nsfw-img': '')+"
replace: '$&(this.props?.channel?.nsfw || $self.settings.store.blurAllChannels ? "vc-nsfw-img ": "")+'
}
]
}

View file

@ -98,7 +98,7 @@ export default definePlugin({
},
...[
'"Message Username"', // Messages
'?"white":"black",width', // Nameplate preview
"#{intl::COLLECTIBLES_NAMEPLATE_PREVIEW_A11Y}", // Nameplate preview
"#{intl::ayozFl::raw}", // Avatar preview
].map(find => ({
find,

View file

@ -33,6 +33,14 @@ export default definePlugin({
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:true})"
}
},
// User Profile Modal
{
find: ",applicationRoleConnection:",
replacement: {
match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id),.{0,100}}\)}\),/,
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false}),"
}
},
// User Profile Modal v2
{
find: ".MODAL_V2,onClose:",

View file

@ -256,11 +256,8 @@ export default definePlugin({
{
find: "#{intl::SETTINGS_GAMES_TOGGLE_OVERLAY}",
replacement: {
// let { ... nowPlaying: a = !1 ...
// let { overlay: b ... } = Props ...
// ToggleOverLayButton(), nowPlaying && ... RemoveGameButton()
match: /\.Fragment,\{children:.+?,\i\(\),(?<=nowPlaying:(\i)=!1,.+?overlay:\i,[^}]+?\}=(\i).+?)(?=\1&&)/,
replace: (m, nowPlaying, props) => `${m}$self.renderToggleGameActivityButton(${props},${nowPlaying}),`,
match: /(\i)&&!\i\|\|\i\?null(?<=return (\i)\.verified.+?)/,
replace: "$self.renderToggleGameActivityButton($2,$1),$&"
}
},
@ -268,8 +265,8 @@ export default definePlugin({
{
find: "#{intl::EMBEDDED_ACTIVITIES_DEVELOPER_ACTIVITY}",
replacement: {
match: /,rendersPlaceholder:.+?children:\i.*?}\),(?<=application:(\i).+?)/,
replace: (m, props) => `${m}$self.renderToggleActivityButton(${props}),`
match: /lineClamp:1.{0,50}?(?=!\i&&\i\?.+?application:(\i))/,
replace: "$&$self.renderToggleActivityButton($1),"
}
}
],

View file

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

View file

@ -752,7 +752,7 @@ export default definePlugin({
{
// Attachment renderer
find: ".Types.ATTACHMENT,inline:",
find: "#{intl::REMOVE_ATTACHMENT_TOOLTIP_TEXT}",
replacement: [
{
match: /\.SPOILER,(?=\[\i\.\i\]:)/,
@ -779,7 +779,7 @@ export default definePlugin({
find: ".SEND_FAILED,",
replacement: {
// Render editHistory behind the message content
match: /\]:\i.isUnsupported.+?,children:\[/,
match: /\]:\i.isUnsupported.{0,20}?,children:\[/,
replace: "$&arguments[0]?.message?.editHistory?.length>0&&$self.renderEdits(arguments[0]),"
}
},
@ -788,7 +788,7 @@ export default definePlugin({
find: "#{intl::MESSAGE_EDITED}",
replacement: {
// Make edit marker clickable
match: /(isInline:!1,children:.+?)"span",\{(?=className:)/,
match: /(isInline:!1,children:.{0,50}?)"span",\{(?=className:)/,
replace: "$1$self.EditMarker,{message:arguments[0].message,"
}
},

View file

@ -35,8 +35,7 @@ const UserUtils = findByPropsLazy("getGlobalName");
const ProfileListClasses = findCssClassesLazy("empty", "textContainer", "connectionIcon");
const TabBarClasses = findCssClassesLazy("tabPanelScroller", "tabBarPanel");
const MutualsListClasses = findCssClassesLazy("row", "icon", "name", "details");
// FIXME
const ExpandableList = findComponentByCodeLazy('"PRESS_SECTION"');
const ExpandableList = findComponentByCodeLazy('action:"PRESS_SECTION"', "section");
function getGroupDMName(channel: Channel) {
return channel.name ||

View file

@ -24,7 +24,7 @@ import { getIntlMessage } from "@utils/discord";
import { classes } from "@utils/misc";
import type { Guild, GuildMember, RoleOrUserPermission } from "@vencord/discord-types";
import { PermissionOverwriteType } from "@vencord/discord-types/enums";
import { filters, findBulk, proxyLazyWebpack } from "@webpack";
import { findCssClassesLazy } from "@webpack";
import { PermissionsBits, Tooltip, useMemo, UserStore } from "@webpack/common";
import { PermissionsSortOrder, settings } from "..";
@ -39,14 +39,8 @@ interface UserPermission {
type UserPermissions = Array<UserPermission>;
const { RoleClasses, RoleBorderClasses } = proxyLazyWebpack(() => {
const [RoleClasses, RoleBorderClasses] = findBulk(
filters.byProps("role", "roleCircle", "roleName"),
filters.byProps("roleCircle", "dot", "dotBorderColor")
) as Record<string, string>[];
return { RoleClasses, RoleBorderClasses };
});
const RoleClasses = findCssClassesLazy("role", "roleName", "roleRemoveButton", "roleNameOverflow", "root");
const RoleBorderClasses = findCssClassesLazy("roleCircle", "dot", "dotBorderColor");
interface FakeRoleProps extends React.HTMLAttributes<HTMLDivElement> {
text: string;
@ -58,7 +52,7 @@ function FakeRole({ text, color, ...props }: FakeRoleProps) {
<div {...props} className={classes(RoleClasses.role)}>
<div className={RoleClasses.roleRemoveButton}>
<span
className={classes(RoleBorderClasses.roleCircle, RoleClasses.roleCircle)}
className={RoleBorderClasses.roleCircle}
style={{ backgroundColor: color }}
/>
</div>

View file

@ -30,7 +30,7 @@ export default definePlugin({
{
find: '["VIDEO","CLIP","AUDIO"]',
replacement: {
match: /(\[\i>0&&\i\.length>0.+?children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/,
match: /(\[\i>0&&\i\.length>0.{0,150}?children:)(\i.slice\(\i\))(?<=showDownload:(\i).+?isVisualMediaType:(\i).+?)/,
replace: (_, rest, origChildren, showDownload, isVisualMediaType) => `${rest}[${showDownload}&&${isVisualMediaType}&&$self.PictureInPictureButton(),...${origChildren}]`
}
}

View file

@ -96,7 +96,7 @@ export default definePlugin({
replace: "$&if($self.isCategoryIndex($1.section))return $self.renderCategory($1);"
},
{
match: /"renderSection".+?"span",{/,
match: /"renderSection".{0,300}?"span",{/,
replace: "$&...$self.makeSpanProps(),"
},

View file

@ -32,13 +32,8 @@ export default definePlugin({
replacement: [
{
// Discord always renders both plain and guild icons folders and uses a css transtion to switch between them
// let {hovered: h, sorting: s} = props;
// hasFolderButtonContent = h && s;
// ...
// className: cn({[_1]: hasFolderButtonContent, [_2]: !hasFolderButtonContent}),
// children: [!hasFolderButtonContent && ...]
match: /className:\i\(\)\(\{\[\i\.\i\]:(\i),\[\i\.\i\]:!\1(?=.{0,30}children:\[!\i&&)/,
replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":${hasFolderButtonContent}`
match: /\.slice\(0,4\).+?\]:(\i),\[\i\.\i\]:!\1/,
replace: (m, hasFolderButtonContent) => `${m},"vc-plainFolderIcon-plain":!${hasFolderButtonContent}`
}
]

View file

@ -107,8 +107,8 @@ export default definePlugin({
find: 'tutorialId:"whos-online',
replacement: [
{
match: /(?<=\}\):null,).{0,100}— ",\i\]\}\)\]/,
replace: "$self.RoleGroupColor(arguments[0])]"
match: /(#{intl::CHANNEL_MEMBERS_A11Y_LABEL}.+}\):null,).{0,100}?— ",\i\]\}\)\]/,
replace: (_, rest) => `${rest}$self.RoleGroupColor(arguments[0])]`
},
],
predicate: () => settings.store.memberList
@ -128,8 +128,8 @@ export default definePlugin({
find: "#{intl::GUEST_NAME_SUFFIX})]",
replacement: [
{
match: /#{intl::GUEST_NAME_SUFFIX}\)\].+?\](?=\}\).*?userId:(\i\.id),contextGuildId:(\i))/,
replace: "$&,style:$self.getColorStyle($1,$2),"
match: /#{intl::GUEST_NAME_SUFFIX}.{0,50}?"".{0,50}\](?=\}\))(?<=guildId:(\i),.{0,50}?user:(\i).+?)/,
replace: "$&,style:$self.getColorStyle($2.id,$1),"
}
],
predicate: () => settings.store.voiceUsers
@ -147,7 +147,7 @@ export default definePlugin({
{
find: ",reactionVoteCounts",
replacement: {
match: /className:\i\.\i,(?="aria-label".{0,200}usernameClass)/,
match: /\.SIZE_32.+?variant:"text-md\/normal",className:\i\.\i,(?="aria-label":)/,
replace: "$&style:$self.getColorStyle(arguments[0]?.user?.id,arguments[0]?.channel?.id),"
},
predicate: () => settings.store.pollResults
@ -156,7 +156,7 @@ export default definePlugin({
{
find: ".SEND_FAILED,",
replacement: {
match: /(?<=\]:(\i)\.isUnsupported.+?,)(?=children:\[)/,
match: /(?<=\]:(\i)\.isUnsupported.{0,50}?,)(?=children:\[)/,
replace: "style:$self.useMessageColorsStyle($1),"
},
predicate: () => settings.store.colorChatMessages

View file

@ -196,12 +196,12 @@ export default definePlugin({
replacement: [
// Make the channel appear as muted if it's hidden
{
match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\))(?<={channel:(\i),name:\i,muted:(\i).+?;)/,
match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\)\(\i\.\i,{focusTarget:)(?<={channel:(\i),name:\i,muted:(\i).+?;)/,
replace: (m, channel, muted) => `${m}${muted}=$self.isHiddenChannel(${channel})?true:${muted};`
},
// Make voice channels also appear as muted if they are muted
{
match: /(?<=\?\i\.\i:\i\.\i,)(.+?)if\((\i)(?:\)return |\?)(\i\.MUTED)/,
match: /(?<=\?\i\.\i:\i\.\i,)(.{0,150}?)if\((\i)(?:\)return |\?)(\i\.MUTED)/,
replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return ""`
}
]
@ -216,7 +216,7 @@ export default definePlugin({
},
{
// Hide unreads
match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\))(?<={channel:(\i),name:\i,.+?unread:(\i).+?)/,
match: /Children\.count.+?;(?=return\(0,\i\.jsxs?\)\(\i\.\i,{focusTarget:)(?<={channel:(\i),name:\i,.+?unread:(\i).+?)/,
replace: (m, channel, unread) => `${m}${unread}=$self.isHiddenChannel(${channel})?false:${unread};`
}
]
@ -324,7 +324,7 @@ export default definePlugin({
},
{
// Patch the header to only return allowed users and roles if it's a hidden channel or locked channel (Like when it's used on the HiddenChannelLockScreen)
match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[function.+?\]}\)),)/,
match: /return\(0,\i\.jsxs?\)\(\i\.\i,{channelId:(\i)\.id(?=.+?(\(0,\i\.jsxs?\)\("div",{className:\i\.\i,children:\[.{0,100}\i\.length>0.+?\]}\)),)/,
replace: (m, channel, allowedUsersAndRolesComponent) => `if($self.isHiddenChannel(${channel},true)){return${allowedUsersAndRolesComponent};}${m}`
},
{
@ -391,7 +391,7 @@ export default definePlugin({
},
{
// Disable bad CSS class which mess up hidden voice channels styling
match: /(?=\i\|\|\i!==\i\.\i\.FULL_SCREEN)/,
match: /(?=\i\|\|\i!==\i\.\i\.FULL_SCREEN.{0,100}?this\._callContainerRef)/,
replace: '$&!this.props.inCall&&$self.isHiddenChannel(this.props.channel,true)?"":'
}
]
@ -431,7 +431,7 @@ export default definePlugin({
},
{
// Remove the open chat button for the HiddenChannelLockScreen
match: /(?<=onClick:.{0,70}?toggleParticipantsList.{0,150}?\),!\i&&)\(0,\i\.jsxs?\).{0,280}iconClassName/,
match: /(?<="participants-list-button"\),!\i&&)\(0,\i\.jsxs?\).{0,280}?iconClassName:/,
replace: "!$self.isHiddenChannel(arguments[0]?.channel,true)&&$&"
}
]
@ -461,7 +461,7 @@ export default definePlugin({
},
},
{
find: 'className:"channelMention",children',
find: 'className:"channelMention",children:',
replacement: {
// Show inside voice channel instead of trying to join them when clicking on a channel mention
match: /(?<=getChannel\(\i\);null!=(\i))(?=.{0,100}?selectVoiceChannel)/,

View file

@ -72,8 +72,8 @@ export default definePlugin({
find: "#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}),children:",
predicate: () => settings.store.showModView,
replacement: {
match: /(?<=#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}.{0,80})role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+)/,
replace: "role:$self.getHighestRole(arguments[0])",
match: /(#{intl::GUILD_MEMBER_MOD_VIEW_HIGHEST_ROLE}.{0,80})role:\i(?<=\[\i\.roles,\i\.highestRoleId,(\i)\].+?)/,
replace: (_, rest, roles) => `${rest}role:$self.getHighestRole(arguments[0],${roles})`,
}
},
// allows you to open mod view on yourself

View file

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

View file

@ -28,10 +28,10 @@ export default definePlugin({
// Add data-author-id and data-is-self to all messages
{
find: ".referencedUsernameProfile,referencedAvatarProfile:",
find: "Message must not be a thread starter message",
replacement: {
match: /\.\i(?=,"aria-setsize":-1,children:.+?#{intl::MESSAGE_A11Y_ROLE_DESCRIPTION})/,
replace: "$&,...$self.getMessageProps(arguments[0])"
match: /"aria-setsize":-1,(?=.{0,150}?#{intl::MESSAGE_A11Y_ROLE_DESCRIPTION})/,
replace: "...$self.getMessageProps(arguments[0]),$&"
}
},

View file

@ -70,7 +70,7 @@ export default definePlugin({
{
find: "null!=this.peopleListItemRef.current",
replacement: {
match: /className:\i\.\i,children:\[(?<=isFocused:(\i).+?isProvisional.{0,50})/,
match: /\.isProvisional.{0,50}?className:\i\.\i,children:\[(?<=isFocused:(\i).+?)/,
replace: "$&$self.VoiceChannelIndicator({userId:this?.props?.user?.id,isActionButton:true,shouldHighlight:$1}),"
},
predicate: () => settings.store.showInMemberList

View file

@ -198,16 +198,16 @@ export default definePlugin({
{
find: "imageClassName:null!=",
replacement: {
match: /(?<=\("div",\i\(\i\(\{\},\i\),)(\{className:)/,
replace: '{style:{cursor:"pointer"},onClick:()=>$self.openAvatar($self.getAvatarUrl(arguments[0].user)),className:'
match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",.{0,100}className:\i,/,
replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openAvatar($1)},",
}
},
// Banners
{
find: 'backgroundColor:"COMPLETE"',
replacement: {
match: /(?<=!1\),)style:{(?=.+?backgroundImage:null!=(\i)\?"url\("\.concat\(\1,)/,
replace: (_, bannerSrc) => `onClick:()=>${bannerSrc}!=null&&$self.openBanner(${bannerSrc}),style:{cursor:${bannerSrc}!=null?"pointer":void 0,`
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,`
}
},
// Group DMs top small & large icon
@ -235,9 +235,5 @@ export default definePlugin({
replace: (_, avatarUrl) => `onClick:()=>$self.openAvatar(${avatarUrl}),`
}
}
],
getAvatarUrl(user: User) {
return IconUtils.getUserAvatarURL(user, true);
},
]
});

View file

@ -15,7 +15,7 @@ export default definePlugin({
authors: [Devs.puv],
patches: [
{
find: "VOICE_MESSAGE_PLAYBACK_STARTED,{src:",
find: "#{intl::LgCPMt::raw}",
replacement: {
match: /(?<=onVolumeHide:\i\}\))/,
replace: ",$self.renderDownload(arguments[0].src)"