mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-14 16:33:52 +00:00
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:
parent
19bfaaef97
commit
e4bd380c0d
2 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue