diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-08-12 19:20:18 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-08-12 19:20:18 +0200 |
commit | 6d39615998dee7b30565d34a9f209b569678fb6a (patch) | |
tree | 477fdbe6d1f385e797e58e64cbc3af9bdbda9a64 /src/modules/m_connectban.cpp | |
parent | 1e89f510705753a33644b0356cdd902ecc2d9128 (diff) |
Add ConfigTag::getDuration() with optional bounds checking
Diffstat (limited to 'src/modules/m_connectban.cpp')
-rw-r--r-- | src/modules/m_connectban.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp index 36e10ec5b..227373a36 100644 --- a/src/modules/m_connectban.cpp +++ b/src/modules/m_connectban.cpp @@ -46,9 +46,7 @@ class ModuleConnectBan : public Module ipv4_cidr = tag->getInt("ipv4cidr", 32, 1, 32); ipv6_cidr = tag->getInt("ipv6cidr", 128, 1, 128); threshold = tag->getInt("threshold", 10, 1); - banduration = InspIRCd::Duration(tag->getString("duration", "10m")); - if (banduration == 0) - banduration = 10*60; + banduration = tag->getDuration("duration", 10*60, 1); } void OnSetUserIP(LocalUser* u) CXX11_OVERRIDE |