From 13c59f47cb76d7f88d0cb3e0bffa6320a9b544a5 Mon Sep 17 00:00:00 2001 From: Amia <9750071+aamiaa@users.noreply.github.com> Date: Wed, 25 Oct 2023 20:01:25 +0200 Subject: [PATCH] fix: MutualGroupDMs (#1879) --- src/plugins/mutualGroupDMs/index.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx index d445522b..226d000f 100644 --- a/src/plugins/mutualGroupDMs/index.tsx +++ b/src/plugins/mutualGroupDMs/index.tsx @@ -47,16 +47,17 @@ export default definePlugin({ patches: [ { find: ".Messages.USER_PROFILE_MODAL", // Note: the module is lazy-loaded - replacement: [ - { - match: /(?<=\.MUTUAL_GUILDS\}\),)(?=(\i\.bot).{0,20}(\(0,\i\.jsx\)\(.{0,100}id:))/, - replace: '$1?null:$2"MUTUAL_GDMS",children:"Mutual Groups"}),' - }, - { - match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/, - replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs($1,$2);" - } - ] + replacement: { + 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"}),' + } + }, + { + find: ".UserProfileSections.USER_INFO_CONNECTIONS:", + replacement: { + match: /(?<={user:(\i),onClose:(\i)}\);)(?=case \i\.\i\.MUTUAL_FRIENDS)/, + replace: "case \"MUTUAL_GDMS\":return $self.renderMutualGDMs($1,$2);" + } } ],