From 746627c4b59d685c67ec361727f35222444f0d87 Mon Sep 17 00:00:00 2001 From: MD <1917406+mdcfe@users.noreply.github.com> Date: Sun, 4 Feb 2024 01:47:20 +0000 Subject: [PATCH] Use sendTl to ensure message format is parsed (#5632) Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com> --- .../essentials/messaging/SimpleMessageRecipient.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/messaging/SimpleMessageRecipient.java b/Essentials/src/main/java/com/earth2me/essentials/messaging/SimpleMessageRecipient.java index b4e467aa1..6372ccdf3 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/messaging/SimpleMessageRecipient.java +++ b/Essentials/src/main/java/com/earth2me/essentials/messaging/SimpleMessageRecipient.java @@ -95,10 +95,10 @@ public class SimpleMessageRecipient implements IMessageRecipient { final MessageResponse messageResponse = recipient.onReceiveMessage(this.parent, message); switch (messageResponse) { case UNREACHABLE: - sendMessage(tlSender("recentlyForeverAlone", CommonPlaceholders.displayNameRecipient(recipient))); + sendTl("recentlyForeverAlone", recipient.getDisplayName()); break; case MESSAGES_IGNORED: - sendMessage(tlSender("msgIgnore", CommonPlaceholders.displayNameRecipient(recipient))); + sendTl("msgIgnore", recipient.getDisplayName()); break; case SENDER_IGNORED: break; @@ -106,13 +106,13 @@ public class SimpleMessageRecipient implements IMessageRecipient { case SUCCESS_BUT_AFK: // Currently, only IUser can be afk, so we unsafely cast to get the afk message. if (((IUser) recipient).getAfkMessage() != null) { - sendMessage(tlSender("userAFKWithMessage", CommonPlaceholders.displayNameRecipient(recipient), ((IUser) recipient).getAfkMessage())); + sendTl("userAFKWithMessage", recipient.getDisplayName(), ((IUser) recipient).getAfkMessage()); } else { - sendMessage(tlSender("userAFK", CommonPlaceholders.displayNameRecipient(recipient))); + sendTl("userAFK", recipient.getDisplayName()); } // fall through default: - sendMessage(tlLiteral("msgFormat", AdventureUtil.parsed(tlSender("meSender")), CommonPlaceholders.displayNameRecipient(recipient), message)); + sendTl("msgFormat", AdventureUtil.parsed(tlSender("meSender")), recipient.getDisplayName(), message); // Better Social Spy if (ess.getSettings().isSocialSpyMessages()) { @@ -170,7 +170,7 @@ public class SimpleMessageRecipient implements IMessageRecipient { } } // Display the formatted message to this recipient. - sendMessage(tlLiteral("msgFormat", CommonPlaceholders.displayNameRecipient(sender), tlSender("meRecipient"), message)); + sendTl("msgFormat", sender.getDisplayName(), AdventureUtil.parsed(tlSender("meRecipient")), message); if (isLastMessageReplyRecipient) { // If this recipient doesn't have a reply recipient, initiate by setting the first