From 4e709692f1ca6b88dd7ecd7c3774083c843f95d9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 28 Mar 2026 14:45:51 -0700 Subject: [PATCH] fix: filter officer chat for non-officers (server sends to all guild members) Some private servers (AzerothCore/ChromieCraft) send OFFICER chat type to all guild members regardless of rank. The real WoW client checks the GR_RIGHT_OFFCHATLISTEN (0x80) guild rank permission before displaying. Now checks the player's guild rank rights from the roster data and suppresses officer chat if the permission bit is not set. --- src/game/chat_handler.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/game/chat_handler.cpp b/src/game/chat_handler.cpp index 8d2308d9..327efc3c 100644 --- a/src/game/chat_handler.cpp +++ b/src/game/chat_handler.cpp @@ -196,6 +196,24 @@ void ChatHandler::handleMessageChat(network::Packet& packet) { } } + // Filter officer chat if player doesn't have officer chat permission. + // Some servers send officer chat to all guild members regardless of rank. + // WoW guild right bit 0x40 = GR_RIGHT_OFFCHATSPEAK, 0x80 = GR_RIGHT_OFFCHATLISTEN + if (data.type == ChatType::OFFICER) { + const auto& roster = owner_.getGuildRoster(); + uint64_t myGuid = owner_.getPlayerGuid(); + uint32_t myRankIdx = 0; + for (const auto& m : roster.members) { + if (m.guid == myGuid) { myRankIdx = m.rankIndex; break; } + } + if (myRankIdx < roster.ranks.size()) { + uint32_t rights = roster.ranks[myRankIdx].rights; + if (!(rights & 0x80)) { // GR_RIGHT_OFFCHATLISTEN = 0x80 + return; // Don't show officer chat to non-officers + } + } + } + // Filter addon-to-addon whispers (GearScore, DBM, oRA, etc.) from player chat. // These are invisible in the real WoW client. if (data.type == ChatType::WHISPER || data.type == ChatType::WHISPER_INFORM) {