fix: MutualGroupDMs (#1879)

This commit is contained in:
Amia 2023-10-25 20:01:25 +02:00 committed by GitHub
parent 0d7157dd20
commit 13c59f47cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,16 +47,17 @@ export default definePlugin({
patches: [ patches: [
{ {
find: ".Messages.USER_PROFILE_MODAL", // Note: the module is lazy-loaded find: ".Messages.USER_PROFILE_MODAL", // Note: the module is lazy-loaded
replacement: [ replacement: {
{ match: /(?<=\.MUTUAL_GUILDS\}\),)(?=(\i\.bot).{0,20}(\(0,\i\.jsx\)\(.{0,100}id:))/,
match: /(?<=\.MUTUAL_GUILDS\}\),)(?=(\i\.bot).{0,20}(\(0,\i\.jsx\)\(.{0,100}id:))/, replace: '($1||arguments[0].isCurrentUser)?null:$2"MUTUAL_GDMS",children:"Mutual Groups"}),'
replace: '$1?null:$2"MUTUAL_GDMS",children:"Mutual Groups"}),' }
}, },
{ {
match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/, find: ".UserProfileSections.USER_INFO_CONNECTIONS:",
replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs($1,$2);" replacement: {
} match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/,
] replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs($1,$2);"
}
} }
], ],