diff options
| author | 2026-03-02 22:49:44 +0000 | |
|---|---|---|
| committer | 2026-03-02 22:49:44 +0000 | |
| commit | 602527b3a8450f38b5894f23e8ed7bc720a4a6db (patch) | |
| tree | 7d70d3089c9f195b2e14c900473bc989bacb5a9b /modules/messageflood.cpp | |
| parent | Fix kicking with multiple channels. (diff) | |
| parent | Update irctest. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'modules/messageflood.cpp')
| -rw-r--r-- | modules/messageflood.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/messageflood.cpp b/modules/messageflood.cpp index cfba1b513..578963388 100644 --- a/modules/messageflood.cpp +++ b/modules/messageflood.cpp @@ -51,7 +51,7 @@ struct MsgFloodData final class MsgFloodSettings final { private: - using CounterMap = insp::flat_map<User*, MsgFloodData>; + using CounterMap = insp::flat_map<std::string, MsgFloodData>; CounterMap counters; public: @@ -71,7 +71,7 @@ public: { auto it = Find(who); if (it == counters.end()) - it = counters.emplace(who, MsgFloodData(period)).first; + it = counters.emplace(who->uuid, MsgFloodData(period)).first; it->second.messages += weight; return (it->second.messages >= this->messages); @@ -79,10 +79,9 @@ public: void Clear(User* who) { - counters.erase(who); + counters.erase(who->uuid); } - CounterMap::iterator Find(User* who) { auto found = false; @@ -93,7 +92,7 @@ public: it = counters.erase(it); else { - if (it->first == who) + if (it->first == who->uuid) { found = true; ret = it; |
