diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-05 17:39:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-05 17:39:36 +0000 |
commit | c2993f666f8146e75b4039b2b7bffe3455a3ac61 (patch) | |
tree | 9672e7a956f241696a337acf9973309c4c2b1e16 /src/modules/m_timedbans.cpp | |
parent | d2717df5ef65c00bb43e1b775c7846af1625848a (diff) |
Sexeger!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7241 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r-- | src/modules/m_timedbans.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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; |