diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-22 20:52:25 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-22 20:52:25 +0000 |
commit | 6401e328bb4dc4ef5cafcb3fe98e4e7f8cd48de5 (patch) | |
tree | ffe61631b2bf1a324e0a663f6ebe4840762688fe /modules | |
parent | 8f0ee6f3834204b44f1e0137c0e70a447d8c420d (diff) | |
parent | 43dc6f75096b63efc9df8f6e313e10f076203e93 (diff) |
Merge branch '2.0' into 2.1.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/nickserv/ns_maxemail.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/nickserv/ns_maxemail.cpp b/modules/nickserv/ns_maxemail.cpp index ab18e4b54..d923dd57c 100644 --- a/modules/nickserv/ns_maxemail.cpp +++ b/modules/nickserv/ns_maxemail.cpp @@ -36,14 +36,14 @@ class NSMaxEmail final 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) @@ -91,17 +91,17 @@ public: 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; } |