summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-13 02:28:37 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-13 02:28:37 +0000
commit456516e3f5372cb0e8f135ce39d4de7df988cb93 (patch)
treede68032924125e3bc23e03757f8c576eb0b32548
parentb92bccf8d7cf9a37b1f8e24b7ed93c6696bde1f4 (diff)
Applied jamie's cmd_gline patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5221 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/cmd_gline.cpp23
1 files changed, 15 insertions, 8 deletions
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]);
}
}