SupportHelper: fix DM warning card

This commit is contained in:
Vendicated 2024-10-09 03:18:31 +02:00
parent 47db61d00e
commit 89bb3ee30a
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -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;