From 3a737480ecb603b79152ff70ee74706b948b0567 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Thu, 13 Apr 2023 02:15:48 -0400 Subject: [PATCH] Remove unneeded sanitization in webhook names (#5311) Regression from 384f63bf92cd3417899e1d3aca22201c3a523d7b --- .../net/essentialsx/discord/JDADiscordService.java | 10 +++++----- .../essentialsx/discord/listeners/BukkitListener.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java b/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java index a381a0ddd..d45cd2617 100644 --- a/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java +++ b/EssentialsDiscord/src/main/java/net/essentialsx/discord/JDADiscordService.java @@ -280,11 +280,11 @@ public class JDADiscordService implements DiscordService, IEssentialsModule { final String avatarUrl = DiscordUtil.getAvatarUrl(this, player); final String formattedName = MessageUtil.formatMessage(getSettings().getMcToDiscordNameFormat(player), - MessageUtil.sanitizeDiscordMarkdown(player.getName()), - MessageUtil.sanitizeDiscordMarkdown(player.getDisplayName()), - MessageUtil.sanitizeDiscordMarkdown(getPlugin().getEss().getSettings().getWorldAlias(player.getWorld().getName())), - MessageUtil.sanitizeDiscordMarkdown(FormatUtil.stripEssentialsFormat(getPlugin().getEss().getPermissionsHandler().getPrefix(player))), - MessageUtil.sanitizeDiscordMarkdown(FormatUtil.stripEssentialsFormat(getPlugin().getEss().getPermissionsHandler().getSuffix(player))), + player.getName(), + player.getDisplayName(), + getPlugin().getEss().getSettings().getWorldAlias(player.getWorld().getName()), + FormatUtil.stripEssentialsFormat(getPlugin().getEss().getPermissionsHandler().getPrefix(player)), + FormatUtil.stripEssentialsFormat(getPlugin().getEss().getPermissionsHandler().getSuffix(player)), guild.getMember(jda.getSelfUser()).getEffectiveName()); DiscordUtil.dispatchDiscordMessage(this, MessageType.DefaultTypes.CHAT, formattedMessage, user.isAuthorized("essentials.discord.ping"), avatarUrl, formattedName, player.getUniqueId()); diff --git a/EssentialsDiscord/src/main/java/net/essentialsx/discord/listeners/BukkitListener.java b/EssentialsDiscord/src/main/java/net/essentialsx/discord/listeners/BukkitListener.java index 6f4bd31c9..e8a7e67ab 100644 --- a/EssentialsDiscord/src/main/java/net/essentialsx/discord/listeners/BukkitListener.java +++ b/EssentialsDiscord/src/main/java/net/essentialsx/discord/listeners/BukkitListener.java @@ -273,11 +273,11 @@ public class BukkitListener implements Listener { } name = MessageUtil.formatMessage(jda.getSettings().getMcToDiscordNameFormat(player), - MessageUtil.sanitizeDiscordMarkdown(player.getName()), - MessageUtil.sanitizeDiscordMarkdown(player.getDisplayName()), - MessageUtil.sanitizeDiscordMarkdown(jda.getPlugin().getEss().getSettings().getWorldAlias(player.getWorld().getName())), - MessageUtil.sanitizeDiscordMarkdown(FormatUtil.stripEssentialsFormat(jda.getPlugin().getEss().getPermissionsHandler().getPrefix(player))), - MessageUtil.sanitizeDiscordMarkdown(FormatUtil.stripEssentialsFormat(jda.getPlugin().getEss().getPermissionsHandler().getSuffix(player))), + player.getName(), + player.getDisplayName(), + jda.getPlugin().getEss().getSettings().getWorldAlias(player.getWorld().getName()), + FormatUtil.stripEssentialsFormat(jda.getPlugin().getEss().getPermissionsHandler().getPrefix(player)), + FormatUtil.stripEssentialsFormat(jda.getPlugin().getEss().getPermissionsHandler().getSuffix(player)), jda.getGuild().getMember(jda.getJda().getSelfUser()).getEffectiveName()); uuid = player.getUniqueId();