From 7cc36dc9ccad26dad216217f0527c1fe5c1072eb Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Sun, 22 Mar 2026 17:40:36 +0000 Subject: Reset IC message text input on send Instead of waiting for the incoming message and checking that you've sent it by comparing character IDs, reset it right away after pressing Enter. From the network standpoint, there's no reason to wait and acknowledge the IC message this way because TCP already ensures reliabile delivery. Removing this avoids sending duplicate messages during lag spikes. It also subjectively improves responsiveness. We lose a bit of convenience. The text box will be cleared even if your message was never broadcast (due to serverside mute, for example), but Ctrl+Z fixes that, and that's how OOC chat has always worked. --- src/courtroom.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index cdc2d9e..bbac24c 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2321,6 +2321,8 @@ void Courtroom::on_chat_return_pressed() } ao_app->send_server_packet(AOPacket("MS", packet_contents)); + // Move it here instead of comparing the sender of incoming IC messages. + reset_ui(); } void Courtroom::reset_ui() @@ -2412,12 +2414,6 @@ void Courtroom::chatmessage_enqueue(QStringList p_contents) p_contents[MESSAGE] = ""; } - // If we determine we sent this message - if (sender) - { - // Reset input UI elements, clear input box, etc. - reset_ui(); - } // If we determine we sent this message, or we have desync enabled if (sender || Options::getInstance().desynchronisedLogsEnabled()) { -- cgit