From 456516e3f5372cb0e8f135ce39d4de7df988cb93 Mon Sep 17 00:00:00 2001 From: special Date: Wed, 13 Sep 2006 02:28:37 +0000 Subject: Applied jamie's cmd_gline patch git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5221 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_gline.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/cmd_gline.cpp b/src/cmd_gline.cpp index 85fe137b4..aff9fcc63 100644 --- a/src/cmd_gline.cpp +++ b/src/cmd_gline.cpp @@ -40,19 +40,26 @@ CmdResult cmd_gline::Handle (const char** parameters, int pcnt, userrec *user) return CMD_FAILURE; } - ServerInstance->XLines->add_gline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddGLine,OnAddGLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); - - if (!ServerInstance->Duration(parameters[1])) + if (ServerInstance->XLines->add_gline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0])) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent G-line for %s.",user->nick,parameters[0]); + FOREACH_MOD(I_OnAddGLine,OnAddGLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); + + if (!ServerInstance->Duration(parameters[1])) + { + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent G-line for %s.",user->nick,parameters[0]); + } + else + { + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); + } + + ServerInstance->XLines->apply_lines(APPLY_GLINES); } else { - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed G-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); + user->WriteServ("NOTICE %s :*** G-Line for %s already exists",user->nick,parameters[0]); } - ServerInstance->XLines->apply_lines(APPLY_GLINES); } else { @@ -63,7 +70,7 @@ CmdResult cmd_gline::Handle (const char** parameters, int pcnt, userrec *user) } else { - user->WriteServ("NOTICE %s :*** G-Line %s not found in list, try /stats g.",user->nick,parameters[0]); + user->WriteServ("NOTICE %s :*** G-line %s not found in list, try /stats g.",user->nick,parameters[0]); } } -- cgit v1.2.3