From 89bb3ee30af21a5799507941ad0610164037f356 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 9 Oct 2024 03:18:31 +0200 Subject: [PATCH] SupportHelper: fix DM warning card --- src/plugins/_core/supportHelper.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 432896fc7..d0ebdb33a 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -149,8 +149,8 @@ export default definePlugin({ patches: [{ find: ".BEGINNING_DM.format", replacement: { - match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,100}userId:(\i\.getRecipientId\(\)))/, - replace: "$& $self.ContributorDmWarningCard({ userId: $1 })," + match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,300}(\i)\.isMultiUserDM)/, + replace: "$& $self.renderContributorDmWarningCard({ channel: $1 })," } }], @@ -235,7 +235,8 @@ export default definePlugin({ } }, - ContributorDmWarningCard: ErrorBoundary.wrap(({ userId }) => { + renderContributorDmWarningCard: ErrorBoundary.wrap(({ channel }) => { + const userId = channel.getRecipientId(); if (!isPluginDev(userId)) return null; if (RelationshipStore.isFriend(userId) || isPluginDev(UserStore.getCurrentUser()?.id)) return null;