diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_filter_pcre.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_dccallow.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_dnsbl.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_filter.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 9 |
5 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index c2cc1f40f..e25fd06bb 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -139,7 +139,7 @@ class ModuleFilterPCRE : public FilterBase std::string reason = MyConf.ReadValue("keyword", "reason", index); std::string action = MyConf.ReadValue("keyword", "action", index); std::string flags = MyConf.ReadValue("keyword", "flags", index); - long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index).c_str()); + long gline_time = ServerInstance->Duration(MyConf.ReadValue("keyword", "duration", index)); if (action.empty()) action = "none"; if (flags.empty()) diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index e875302b8..817057b87 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -161,7 +161,7 @@ class cmd_dccallow : public command_t long length; if (pcnt < 2) { - length = ServerInstance->Duration(default_length.c_str()); + length = ServerInstance->Duration(default_length); } else if (!atoi(parameters[1])) { diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 70cc40765..5d32a0adb 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -223,7 +223,7 @@ class ModuleDNSBL : public Module e->reason = MyConf->ReadValue("dnsbl", "reason", i); e->domain = MyConf->ReadValue("dnsbl", "domain", i); e->banaction = str2banaction(MyConf->ReadValue("dnsbl", "action", i)); - e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", i).c_str()); + e->duration = ServerInstance->Duration(MyConf->ReadValue("dnsbl", "duration", i)); e->bitmask = MyConf->ReadInteger("dnsbl", "bitmask", i, false); /* yeah, logic here is a little messy */ diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 8feb5be41..926b6b03e 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -106,7 +106,7 @@ class ModuleFilter : public FilterBase std::string reason = MyConf->ReadValue("keyword","reason",index); std::string do_action = MyConf->ReadValue("keyword","action",index); std::string flags = MyConf->ReadValue("keyword","flags",index); - long gline_time = ServerInstance->Duration(MyConf->ReadValue("keyword","duration",index).c_str()); + long gline_time = ServerInstance->Duration(MyConf->ReadValue("keyword","duration",index)); if (do_action.empty()) do_action = "none"; if (flags.empty()) diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 473785149..2f57a966c 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -67,14 +67,13 @@ class cmd_tban : public command_t } TimedBan T; std::string channelname = parameters[0]; - unsigned long expire = ServerInstance->Duration(parameters[1]) + time(NULL); - if (ServerInstance->Duration(parameters[1]) < 1) + long duration = ServerInstance->Duration(parameters[1]); + unsigned long expire = duration + time(NULL); + if (duration < 1) { user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time"); return CMD_FAILURE; } - char duration[MAXBUF]; - snprintf(duration,MAXBUF,"%lu",ServerInstance->Duration(parameters[1])); std::string mask = parameters[2]; const char *setban[32]; setban[0] = parameters[0]; @@ -94,7 +93,7 @@ class cmd_tban : public command_t T.mask = mask; T.expire = expire; TimedBanList.push_back(T); - channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s added a timed ban on %s lasting for %s seconds.", channel->name, user->nick, mask.c_str(), duration); + channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name, user->nick, mask.c_str(), duration); return CMD_SUCCESS; } return CMD_FAILURE; |