summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-16 16:44:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-16 16:44:18 +0000
commit4d1a6696e65f6fa1f96ad357181df6914a624800 (patch)
tree0ceb5574825ca8525826201db34cd40156702761
parentb6b739eec2d973a415f8efd41a2faee948d1540a (diff)
Change to show time/date set and/or time/date to expire, rather than a number of seconds for each, like in cmd_*line
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7334 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_cban.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 996c710f3..df24ddf18 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -55,8 +55,7 @@ class cmd_cban : public command_t
cmd_cban(InspIRCd* Me) : command_t(Me, "CBAN", 'o', 1)
{
this->source = "m_cban.so";
- this->
- syntax = "<channel> [<duration> :<reason>]";
+ this->syntax = "<channel> [<duration> :<reason>]";
}
CmdResult Handle(const char** parameters, int pcnt, userrec *user)
@@ -71,8 +70,8 @@ class cmd_cban : public command_t
{
if (parameters[0] == iter->chname)
{
- unsigned long remaining = (iter->set_on + iter->length) - ServerInstance->Time();
- user->WriteServ( "386 %s %s :Removed CBAN with %lu seconds left before expiry (%s)", user->nick, iter->chname.c_str(), remaining, iter->reason.c_str());
+ long remaining = iter->length + ServerInstance->Time();
+ user->WriteServ("386 %s %s :Removed CBAN due to expire at %s (%s)", user->nick, iter->chname.c_str(), ServerInstance->TimeString(remaining).c_str(), iter->reason.c_str());
cbans.erase(iter);
break;
}
@@ -95,18 +94,18 @@ class cmd_cban : public command_t
if(length > 0)
{
- user->WriteServ( "385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
+ user->WriteServ("385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str());
ServerInstance->WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str());
}
else
{
- user->WriteServ( "385 %s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str());
+ user->WriteServ("385 %s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str());
ServerInstance->WriteOpers("*** %s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str());
}
}
else
{
- user->WriteServ( "403 %s %s :Invalid channel name", user->nick, parameters[0]);
+ user->WriteServ("403 %s %s :Invalid channel name", user->nick, parameters[0]);
return CMD_FAILURE;
}
}
@@ -235,7 +234,7 @@ class ModuleCBan : public Module
{
if (iter->set_on + iter->length <= ServerInstance->Time())
{
- ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set %u seconds ago expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->Time() - iter->set_on);
+ ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set on %s expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->TimeString(iter->set_on).c_str());
cbans.erase(iter);
go_again = true;
}