From 4d1a6696e65f6fa1f96ad357181df6914a624800 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 16 Jun 2007 16:44:18 +0000 Subject: 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 --- src/modules/m_cban.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/modules') 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 = " [ :]"; + this->syntax = " [ :]"; } 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; } -- cgit v1.2.3