From 1f7503c537f8c2d3575f4b17489bf7b048a1e998 Mon Sep 17 00:00:00 2001 From: Collecting Date: Sun, 11 Jan 2026 20:19:17 +0000 Subject: [PATCH] feat(multiplayer): Chatroom QoL Changes & Additions Signed-off-by: Collecting --- src/citron/multiplayer/chat_room.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/citron/multiplayer/chat_room.h b/src/citron/multiplayer/chat_room.h index c6277cdf7..2b34db41c 100644 --- a/src/citron/multiplayer/chat_room.h +++ b/src/citron/multiplayer/chat_room.h @@ -4,6 +4,8 @@ #pragma once +#include // time tracking +#include // storing timestamps #include #include #include @@ -49,6 +51,8 @@ public slots: void OnSendChat(); void OnChatTextChanged(); void PopupContextMenu(const QPoint& menu_location); + void OnChatContextMenu(const QPoint& menu_location); + void OnPlayerDoubleClicked(const QModelIndex& index); void Disable(); void Enable(); void UpdateTheme(); @@ -69,7 +73,13 @@ private: std::unique_ptr ui; std::unordered_set block_list; std::unordered_map icon_cache; - Network::RoomNetwork* room_network = nullptr; // Initialize to nullptr + std::unordered_map color_overrides; + bool chat_muted = false; + bool show_timestamps = true; + Network::RoomNetwork* room_network = nullptr; + std::vector sent_message_timestamps; + static constexpr size_t MAX_MESSAGES_PER_INTERVAL = 3; + static constexpr std::chrono::seconds THROTTLE_INTERVAL{5}; }; Q_DECLARE_METATYPE(Network::ChatEntry);