From b55d5722c581b43ebb854c8403ba25ba5411979f Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 10 Jan 2007 17:36:05 +0000 Subject: Only send snotice if the eline doesnt exist yet git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6288 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_eline.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/cmd_eline.cpp b/src/cmd_eline.cpp index df2455f86..1abe0ca4f 100644 --- a/src/cmd_eline.cpp +++ b/src/cmd_eline.cpp @@ -37,16 +37,18 @@ CmdResult cmd_eline::Handle (const char** parameters, int pcnt, userrec *user) return CMD_FAILURE; } - ServerInstance->XLines->add_eline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddELine,OnAddELine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); - - if (!ServerInstance->Duration(parameters[1])) + if (ServerInstance->XLines->add_eline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0])) { - ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s.",user->nick,parameters[0]); - } - else - { - ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); + FOREACH_MOD(I_OnAddELine,OnAddELine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); + + if (!ServerInstance->Duration(parameters[1])) + { + ServerInstance->SNO->WriteToSnoMask('x',"%s added permanent E-line for %s.",user->nick,parameters[0]); + } + else + { + ServerInstance->SNO->WriteToSnoMask('x',"%s added timed E-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); + } } } else -- cgit v1.2.3