From 6d39615998dee7b30565d34a9f209b569678fb6a Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 12 Aug 2013 19:20:18 +0200 Subject: Add ConfigTag::getDuration() with optional bounds checking --- src/modules/m_connectban.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/modules/m_connectban.cpp') 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 -- cgit v1.2.3