diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-08-05 00:42:20 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-08-05 00:42:26 +0900 |
| commit | 8b3a3bf31fd2f9dd384e9b66b8d2033e5e36a877 (patch) | |
| tree | 886050233e2f04592743f02724029562b0a87626 /platform-paper/src/main | |
| parent | 2c9b4c83298ea67e2e7b576fd7209b5bc782f23c (diff) | |
| download | LunaticChat-8b3a3bf31fd2f9dd384e9b66b8d2033e5e36a877.tar.gz LunaticChat-8b3a3bf31fd2f9dd384e9b66b8d2033e5e36a877.tar.bz2 LunaticChat-8b3a3bf31fd2f9dd384e9b66b8d2033e5e36a877.zip | |
fix: record the reply target only where /reply can see it
Both commands already record the conversation on the command thread before
queueing the delivery, for the same reason recordRemoteRecipient exists: /reply
reads the target there. Recording it again inside the queued work was not only
redundant but late, re-inserting entries that clearPlayer had already swept - so
lastMessager grew by one dead UUID every time a recipient quit mid-delivery.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'platform-paper/src/main')
| -rw-r--r-- | platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/chat/handler/DirectMessageHandler.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/chat/handler/DirectMessageHandler.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/chat/handler/DirectMessageHandler.kt index 7e9cf1c..2033661 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/chat/handler/DirectMessageHandler.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/chat/handler/DirectMessageHandler.kt @@ -118,8 +118,11 @@ class DirectMessageHandler( /** * Sends a direct message from one player to another on the same server. - * Handles formatting and recording the conversation. - * Applies romaji-to-Japanese conversion if sender has it enabled. + * Handles formatting, and applies romaji-to-Japanese conversion if sender has it enabled. + * + * The conversation is recorded by the caller via [recordMessage] before the delivery is queued, + * for the same reason as [recordRemoteRecipient]. Recording it here as well would also re-insert + * entries that [clearPlayer] has already swept, if the recipient quits mid-delivery. * * @return true if message was sent successfully */ @@ -128,8 +131,6 @@ class DirectMessageHandler( recipient: Player, message: String, ): Boolean { - recordMessage(sender, recipient) - val senderSettings = settingsManager?.getSettings(sender.uniqueId) val recipientSettings = settingsManager?.getSettings(recipient.uniqueId) |
