summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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]);
}
}