Skip to content

Commit

Permalink
SupportHelper: fix DM warning card
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated authored and Autumnlight02 committed Nov 20, 2024
1 parent 0e8db8d commit 4b5fee6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/plugins/_core/supportHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),"
}
}],

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4b5fee6

Please sign in to comment.