fix(chat): prevent AFK/DND auto-reply whisper spam loop

Auto-reply was sent on every incoming whisper with no dedup, causing
infinite loops when both players had auto-reply enabled. Now tracks
which senders have been replied to and only sends one auto-reply per
sender per AFK/DND session.
This commit is contained in:
Kelsi 2026-04-05 04:50:40 -07:00
parent 19bfaaef97
commit e4bd380c0d
2 changed files with 10 additions and 2 deletions

View file

@ -8,6 +8,7 @@
#include <functional>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
namespace wowee {
@ -67,6 +68,10 @@ private:
std::deque<MessageChatData> chatHistory_;
size_t maxChatHistory_ = 100;
std::vector<std::string> joinedChannels_;
// Track senders we've already auto-replied to (AFK/DND) this session
// to prevent infinite reply loops. Cleared when AFK/DND is toggled off.
std::unordered_set<std::string> afkAutoRepliedSenders_;
};
} // namespace game