summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd.h2
-rw-r--r--src/commands/cmd_eline.cpp3
-rw-r--r--src/commands/cmd_gline.cpp2
-rw-r--r--src/commands/cmd_invite.cpp2
-rw-r--r--src/commands/cmd_kline.cpp2
-rw-r--r--src/commands/cmd_qline.cpp2
-rw-r--r--src/commands/cmd_who.cpp4
-rw-r--r--src/commands/cmd_zline.cpp3
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/helperfuncs.cpp2
-rw-r--r--src/modules/m_cban.cpp2
-rw-r--r--src/modules/m_chanhistory.cpp2
-rw-r--r--src/modules/m_connectban.cpp2
-rw-r--r--src/modules/m_dccallow.cpp6
-rw-r--r--src/modules/m_dnsbl.cpp2
-rw-r--r--src/modules/m_filter.cpp4
-rw-r--r--src/modules/m_rline.cpp2
-rw-r--r--src/modules/m_setidle.cpp2
-rw-r--r--src/modules/m_shun.cpp4
-rw-r--r--src/modules/m_svshold.cpp3
-rw-r--r--src/modules/m_timedbans.cpp2
21 files changed, 26 insertions, 29 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 13cd92451..099b9dd87 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -735,7 +735,7 @@ class CoreExport InspIRCd
* (one year, two weeks, three days, four hours, six minutes and five seconds)
* @return The total number of seconds
*/
- long Duration(const std::string &str);
+ static unsigned long Duration(const std::string& str);
/** Attempt to compare a password to a string from the config file.
* This will be passed to handling modules which will compare the data
diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp
index ca39f9061..6fd94d1b8 100644
--- a/src/commands/cmd_eline.cpp
+++ b/src/commands/cmd_eline.cpp
@@ -69,8 +69,7 @@ CmdResult CommandEline::Handle (const std::vector<std::string>& parameters, User
if (ServerInstance->HostMatchesEveryone(ih.first+"@"+ih.second,user))
return CMD_FAILURE;
- long duration = ServerInstance->Duration(parameters[1].c_str());
-
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
ELine* el = new ELine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
if (ServerInstance->XLines->AddLine(el, user))
{
diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp
index 6505b7464..25330ffe2 100644
--- a/src/commands/cmd_gline.cpp
+++ b/src/commands/cmd_gline.cpp
@@ -76,7 +76,7 @@ CmdResult CommandGline::Handle (const std::vector<std::string>& parameters, User
return CMD_FAILURE;
}
- long duration = ServerInstance->Duration(parameters[1].c_str());
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
GLine* gl = new GLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
if (ServerInstance->XLines->AddLine(gl, user))
{
diff --git a/src/commands/cmd_invite.cpp b/src/commands/cmd_invite.cpp
index fd595d618..11cb549af 100644
--- a/src/commands/cmd_invite.cpp
+++ b/src/commands/cmd_invite.cpp
@@ -61,7 +61,7 @@ CmdResult CommandInvite::Handle (const std::vector<std::string>& parameters, Use
if (parameters.size() == 3)
{
if (IS_LOCAL(user))
- timeout = ServerInstance->Time() + ServerInstance->Duration(parameters[2]);
+ timeout = ServerInstance->Time() + InspIRCd::Duration(parameters[1]);
else
timeout = ConvToInt(parameters[2]);
}
diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp
index ce3642f91..34920a4bf 100644
--- a/src/commands/cmd_kline.cpp
+++ b/src/commands/cmd_kline.cpp
@@ -76,7 +76,7 @@ CmdResult CommandKline::Handle (const std::vector<std::string>& parameters, User
return CMD_FAILURE;
}
- long duration = ServerInstance->Duration(parameters[1].c_str());
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
KLine* kl = new KLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ih.first.c_str(), ih.second.c_str());
if (ServerInstance->XLines->AddLine(kl,user))
{
diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp
index 3118798e6..2443ed66c 100644
--- a/src/commands/cmd_qline.cpp
+++ b/src/commands/cmd_qline.cpp
@@ -52,7 +52,7 @@ CmdResult CommandQline::Handle (const std::vector<std::string>& parameters, User
return CMD_FAILURE;
}
- long duration = ServerInstance->Duration(parameters[1].c_str());
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
QLine* ql = new QLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
if (ServerInstance->XLines->AddLine(ql,user))
{
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp
index c8cb67694..a15fde68e 100644
--- a/src/commands/cmd_who.cpp
+++ b/src/commands/cmd_who.cpp
@@ -138,7 +138,7 @@ bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext)
match = InspIRCd::Match(user->awaymsg, matchtext);
else if (opt_time)
{
- long seconds = ServerInstance->Duration(matchtext);
+ long seconds = InspIRCd::Duration(matchtext);
// Okay, so time matching, we want all users connected `seconds' ago
if (user->age >= ServerInstance->Time() - seconds)
@@ -197,7 +197,7 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms,
wholine.append(ServerInstance->Config->HideWhoisServer);
else
wholine.append(u->server);
-
+
wholine.append(" " + u->nick + " ");
/* away? */
diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp
index 91d9c6255..5027c94c7 100644
--- a/src/commands/cmd_zline.cpp
+++ b/src/commands/cmd_zline.cpp
@@ -72,8 +72,7 @@ CmdResult CommandZline::Handle (const std::vector<std::string>& parameters, User
if (ServerInstance->IPMatchesEveryone(ipaddr,user))
return CMD_FAILURE;
- long duration = ServerInstance->Duration(parameters[1].c_str());
-
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
ZLine* zl = new ZLine(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), ipaddr);
if (ServerInstance->XLines->AddLine(zl,user))
{
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 6d37574e9..2d918cb74 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -535,7 +535,7 @@ void ServerConfig::Fill()
PID = ConfValue("pid")->getString("file");
WhoWasGroupSize = ConfValue("whowas")->getInt("groupsize");
WhoWasMaxGroups = ConfValue("whowas")->getInt("maxgroups");
- WhoWasMaxKeep = ServerInstance->Duration(ConfValue("whowas")->getString("maxkeep"));
+ WhoWasMaxKeep = InspIRCd::Duration(ConfValue("whowas")->getString("maxkeep"));
MaxChans = ConfValue("channels")->getInt("users", 20);
OperMaxChans = ConfValue("channels")->getInt("opers", 60);
c_ipv4_range = ConfValue("cidr")->getInt("ipv4clone", 32);
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 42cb55cfd..a673c1b14 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -423,7 +423,7 @@ void InspIRCd::SendWhoisLine(User* user, User* dest, int numeric, const char* fo
/** Refactored by Brain, Jun 2009. Much faster with some clever O(1) array
* lookups and pointer maths.
*/
-long InspIRCd::Duration(const std::string &str)
+unsigned long InspIRCd::Duration(const std::string &str)
{
unsigned char multiplier = 0;
long total = 0;
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index a3c0130b9..69eb82e51 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -114,7 +114,7 @@ class CommandCBan : public Command
else
{
// Adding - XXX todo make this respect <insane> tag perhaps..
- long duration = ServerInstance->Duration(parameters[1]);
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
const char *reason = (parameters.size() > 2) ? parameters[2].c_str() : "No reason supplied";
CBan* r = new CBan(ServerInstance->Time(), duration, user->nick.c_str(), reason, parameters[0].c_str());
diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp
index e48e67fe5..036fc1df6 100644
--- a/src/modules/m_chanhistory.cpp
+++ b/src/modules/m_chanhistory.cpp
@@ -70,7 +70,7 @@ class HistoryMode : public ModeHandler
return MODEACTION_DENY;
unsigned int len = ConvToInt(parameter.substr(0, colon));
- int time = ServerInstance->Duration(duration);
+ int time = InspIRCd::Duration(duration);
if (len == 0 || time < 0)
return MODEACTION_DENY;
if (len > maxlines && IS_LOCAL(source))
diff --git a/src/modules/m_connectban.cpp b/src/modules/m_connectban.cpp
index 2a00b36df..de69ab7ed 100644
--- a/src/modules/m_connectban.cpp
+++ b/src/modules/m_connectban.cpp
@@ -59,7 +59,7 @@ class ModuleConnectBan : public Module
if (threshold == 0)
threshold = 10;
- banduration = ServerInstance->Duration(tag->getString("duration", "10m"));
+ banduration = InspIRCd::Duration(tag->getString("duration", "10m"));
if (banduration == 0)
banduration = 10*60;
}
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index e08b5d3d1..7ae20bb3a 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -152,10 +152,10 @@ class CommandDccallow : public Command
std::string mask = target->nick+"!"+target->ident+"@"+target->dhost;
std::string default_length = ServerInstance->Config->ConfValue("dccallow")->getString("length");
- long length;
+ unsigned long length;
if (parameters.size() < 2)
{
- length = ServerInstance->Duration(default_length);
+ length = InspIRCd::Duration(default_length);
}
else if (!atoi(parameters[1].c_str()))
{
@@ -163,7 +163,7 @@ class CommandDccallow : public Command
}
else
{
- length = ServerInstance->Duration(parameters[1]);
+ length = InspIRCd::Duration(parameters[1]);
}
if (!ServerInstance->IsValidMask(mask.c_str()))
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index dcaea4ac3..72414b7a5 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -291,7 +291,7 @@ class ModuleDNSBL : public Module
}
e->banaction = str2banaction(tag->getString("action"));
- e->duration = ServerInstance->Duration(tag->getString("duration", "60"));
+ e->duration = InspIRCd::Duration(tag->getString("duration", "60"));
/* Use portparser for record replies */
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 86ef0d4f6..81457d40c 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -236,7 +236,7 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> &parameters, User
{
if (parameters.size() >= 5)
{
- duration = ServerInstance->Duration(parameters[3]);
+ duration = InspIRCd::Duration(parameters[3]);
reasonindex = 4;
}
else
@@ -661,7 +661,7 @@ void ModuleFilter::ReadFilters()
std::string reason = i->second->getString("reason");
std::string action = i->second->getString("action");
std::string flgs = i->second->getString("flags");
- long gline_time = ServerInstance->Duration(i->second->getString("duration"));
+ unsigned long gline_time = InspIRCd::Duration(i->second->getString("duration"));
if (flgs.empty())
flgs = "*";
diff --git a/src/modules/m_rline.cpp b/src/modules/m_rline.cpp
index 5548d2baa..9e8539b61 100644
--- a/src/modules/m_rline.cpp
+++ b/src/modules/m_rline.cpp
@@ -154,7 +154,7 @@ class CommandRLine : public Command
{
// Adding - XXX todo make this respect <insane> tag perhaps..
- long duration = ServerInstance->Duration(parameters[1]);
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
XLine *r = NULL;
try
diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp
index a74f4abf7..c54881677 100644
--- a/src/modules/m_setidle.cpp
+++ b/src/modules/m_setidle.cpp
@@ -36,7 +36,7 @@ class CommandSetidle : public SplitCommand
CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
{
- time_t idle = ServerInstance->Duration(parameters[0]);
+ int idle = InspIRCd::Duration(parameters[0]);
if (idle < 1)
{
user->WriteNumeric(948, "%s :Invalid idle time.",user->nick.c_str());
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index baeb6215f..bf31cd70e 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -124,11 +124,11 @@ class CommandShun : public Command
else
{
// Adding - XXX todo make this respect <insane> tag perhaps..
- long duration;
+ unsigned long duration;
std::string expr;
if (parameters.size() > 2)
{
- duration = ServerInstance->Duration(parameters[1]);
+ duration = InspIRCd::Duration(parameters[1]);
expr = parameters[2];
}
else
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp
index 128d610ca..93fb8a12f 100644
--- a/src/modules/m_svshold.cpp
+++ b/src/modules/m_svshold.cpp
@@ -122,8 +122,7 @@ class CommandSvshold : public Command
if (parameters.size() < 3)
return CMD_FAILURE;
- // Adding - XXX todo make this respect <insane> tag perhaps..
- long duration = ServerInstance->Duration(parameters[1]);
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
if (ServerInstance->XLines->AddLine(r, user))
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index 421398a44..e10a622e9 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -66,7 +66,7 @@ class CommandTban : public Command
TimedBan T;
std::string channelname = parameters[0];
- long duration = ServerInstance->Duration(parameters[1]);
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
unsigned long expire = duration + ServerInstance->Time();
if (duration < 1)
{