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_dnsbl.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/modules/m_dnsbl.cpp') diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index b457648e6..becc7a6e8 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -289,7 +289,7 @@ class ModuleDNSBL : public Module } e->banaction = str2banaction(tag->getString("action")); - e->duration = InspIRCd::Duration(tag->getString("duration", "60")); + e->duration = tag->getDuration("duration", 60, 1); /* Use portparser for record replies */ @@ -314,11 +314,6 @@ class ModuleDNSBL : public Module std::string location = tag->getTagLocation(); ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): Invalid banaction", location.c_str()); } - else if (e->duration <= 0) - { - std::string location = tag->getTagLocation(); - ServerInstance->SNO->WriteGlobalSno('a', "DNSBL(%s): Invalid duration", location.c_str()); - } else { if (e->reason.empty()) -- cgit v1.3.1-10-gc9f91