diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-22 20:12:18 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-22 20:19:50 +0000 |
commit | 43dc6f75096b63efc9df8f6e313e10f076203e93 (patch) | |
tree | 242588f19e8f7024c55010a6af8d3efe01190160 /modules | |
parent | 883367c1d2bfbac161fa041fef26367c0bde2b54 (diff) |
Fix ns_maxemail miscounting email addresses in some cases.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ns_maxemail.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/ns_maxemail.cpp b/modules/ns_maxemail.cpp index 23cb80405..d6d14ad1d 100644 --- a/modules/ns_maxemail.cpp +++ b/modules/ns_maxemail.cpp @@ -35,14 +35,14 @@ class NSMaxEmail : public Module return cleaned; } - bool CheckLimitReached(CommandSource &source, const Anope::string &email) + bool CheckLimitReached(CommandSource &source, const Anope::string &email, bool ignoreself) { int NSEmailMax = Config->GetModule(this)->Get<int>("maxemails"); if (NSEmailMax < 1 || email.empty()) return false; - if (this->CountEmail(email, source.nc) < NSEmailMax) + if (this->CountEmail(email, ignoreself ? source.GetAccount() : NULL) < NSEmailMax) return false; if (NSEmailMax == 1) @@ -93,17 +93,17 @@ class NSMaxEmail : public Module if (command->name == "nickserv/register") { - if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : "")) + if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : "", false)) return EVENT_STOP; } else if (command->name == "nickserv/set/email") { - if (this->CheckLimitReached(source, params.size() > 0 ? params[0] : "")) + if (this->CheckLimitReached(source, params.size() > 0 ? params[0] : "", true)) return EVENT_STOP; } else if (command->name == "nickserv/ungroup" && source.GetAccount()) { - if (this->CheckLimitReached(source, source.GetAccount()->email)) + if (this->CheckLimitReached(source, source.GetAccount()->email, false)) return EVENT_STOP; } |