diff options
| author | 2023-07-03 09:25:33 +0100 | |
|---|---|---|
| committer | 2023-07-03 09:25:33 +0100 | |
| commit | 6eb5dd5e3da267f141360ffd707b3665271c4b6a (patch) | |
| tree | 4af4e8561489568127d74425e3831cd0a0982d9a /include/modules | |
| parent | Make the globops module optcommon, remove the GLOBOPS capab key. (diff) | |
Fix shun matching (again) and document what the matches do.
Diffstat (limited to 'include/modules')
| -rw-r--r-- | include/modules/shun.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/modules/shun.h b/include/modules/shun.h index 6bff18763..67d2a431e 100644 --- a/include/modules/shun.h +++ b/include/modules/shun.h @@ -47,14 +47,17 @@ public: if (lu && lu->exempt) return false; + // Try to match nick!duser@dhost or nick!ruser@rhost if (InspIRCd::Match(u->GetMask(), matchtext) || InspIRCd::Match(u->GetRealMask(), matchtext)) return true; - if (InspIRCd::Match(u->GetUserAddress(), matchtext)) + // Try to match nick!ruser@address + const std::string addressmask = INSP_FORMAT("{}!{}", u->nick, u->GetUserAddress()); + if (InspIRCd::Match(addressmask, matchtext)) return true; - const std::string addressmask = INSP_FORMAT("{}!{}", u->nick, u->GetAddress()); - if (InspIRCd::MatchCIDR(addressmask, matchtext, ascii_case_insensitive_map)) + // Try to match address + if (InspIRCd::MatchCIDR(u->GetAddress(), matchtext, ascii_case_insensitive_map)) return true; return false; |
