fix: suppress repeated group-join chat spam on every SMSG_GROUP_LIST update

Previously "You are now in a group with N members." was shown on every
GROUP_LIST packet, which fires for each party stat update. Now only show
a message on actual state transitions: joining, leaving the group.
This commit is contained in:
Kelsi 2026-03-13 06:38:50 -07:00
parent 3a143b9b5b
commit e882110e7f

View file

@ -16923,17 +16923,23 @@ void GameHandler::handleGroupList(network::Packet& packet) {
// WotLK 3.3.5a added a roles byte (group level + per-member) for the dungeon finder.
// Classic 1.12 and TBC 2.4.3 do not send the roles byte.
const bool hasRoles = isActiveExpansion("wotlk");
// Snapshot state before reset so we can detect transitions.
const uint32_t prevCount = partyData.memberCount;
const bool wasInGroup = !partyData.isEmpty();
// Reset before parsing — SMSG_GROUP_LIST is a full replacement, not a delta.
// Without this, repeated GROUP_LIST packets push duplicate members.
partyData = GroupListData{};
if (!GroupListParser::parse(packet, partyData, hasRoles)) return;
if (partyData.isEmpty()) {
const bool nowInGroup = !partyData.isEmpty();
if (!nowInGroup && wasInGroup) {
LOG_INFO("No longer in a group");
addSystemChatMessage("You are no longer in a group.");
} else {
LOG_INFO("In group with ", partyData.memberCount, " members");
addSystemChatMessage("You are now in a group with " + std::to_string(partyData.memberCount) + " members.");
} else if (nowInGroup && !wasInGroup) {
LOG_INFO("Joined group with ", partyData.memberCount, " members");
addSystemChatMessage("You are now in a group.");
} else if (nowInGroup && partyData.memberCount != prevCount) {
LOG_INFO("Group updated: ", partyData.memberCount, " members");
}
}