diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-31 17:43:58 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-31 17:43:58 +0000 |
commit | 568f90949aaa882fd8de88669234894e5235b7c6 (patch) | |
tree | 922e3712403c880bc6ad0cc56629387b28320693 | |
parent | 4c62b8741904a5908179e96b31ef1cf170c8564a (diff) |
Make /gline etc compile with new methods
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8431 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/commands/cmd_eline.cpp | 5 | ||||
-rw-r--r-- | src/commands/cmd_gline.cpp | 4 | ||||
-rw-r--r-- | src/commands/cmd_kline.cpp | 4 | ||||
-rw-r--r-- | src/commands/cmd_qline.cpp | 4 | ||||
-rw-r--r-- | src/commands/cmd_zline.cpp | 12 |
5 files changed, 24 insertions, 5 deletions
diff --git a/src/commands/cmd_eline.cpp b/src/commands/cmd_eline.cpp index a0b35bd64..176eef99d 100644 --- a/src/commands/cmd_eline.cpp +++ b/src/commands/cmd_eline.cpp @@ -37,7 +37,9 @@ CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user) } long duration = ServerInstance->Duration(parameters[1]); - if (ServerInstance->XLines->AddELine(duration,user->nick,parameters[2],parameters[0])) + + ELine* el = new ELine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ih.first.c_str(), ih.second.c_str()); + if (!ServerInstance->XLines->AddLine(el)) { FOREACH_MOD(I_OnAddELine,OnAddELine(duration, user, parameters[2], parameters[0])); @@ -54,6 +56,7 @@ CmdResult CommandEline::Handle (const char** parameters, int pcnt, User *user) } else { + delete el; user->WriteServ("NOTICE %s :*** E-Line for %s already exists",user->nick,parameters[0]); } } diff --git a/src/commands/cmd_gline.cpp b/src/commands/cmd_gline.cpp index 04b79a8cd..6a8c8f807 100644 --- a/src/commands/cmd_gline.cpp +++ b/src/commands/cmd_gline.cpp @@ -42,7 +42,8 @@ CmdResult CommandGline::Handle (const char** parameters, int pcnt, User *user) } long duration = ServerInstance->Duration(parameters[1]); - if (ServerInstance->XLines->AddGLine(duration,user->nick,parameters[2],parameters[0])) + GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ih.first.c_str(), ih.second.c_str()); + if (!ServerInstance->XLines->AddLine(gl)) { FOREACH_MOD(I_OnAddGLine,OnAddGLine(duration, user, parameters[2], parameters[0])); @@ -61,6 +62,7 @@ CmdResult CommandGline::Handle (const char** parameters, int pcnt, User *user) } else { + delete gl; user->WriteServ("NOTICE %s :*** G-Line for %s already exists",user->nick,parameters[0]); } diff --git a/src/commands/cmd_kline.cpp b/src/commands/cmd_kline.cpp index 5bdc9dc96..324c92c13 100644 --- a/src/commands/cmd_kline.cpp +++ b/src/commands/cmd_kline.cpp @@ -42,7 +42,8 @@ CmdResult CommandKline::Handle (const char** parameters, int pcnt, User *user) } long duration = ServerInstance->Duration(parameters[1]); - if (ServerInstance->XLines->AddKLine(duration,user->nick,parameters[2],parameters[0])) + KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ih.first.c_str(), ih.second.c_str()); + if (!ServerInstance->XLines->AddLine(kl)) { FOREACH_MOD(I_OnAddKLine,OnAddKLine(duration, user, parameters[2], parameters[0])); @@ -61,6 +62,7 @@ CmdResult CommandKline::Handle (const char** parameters, int pcnt, User *user) } else { + delete kl; user->WriteServ("NOTICE %s :*** K-Line for %s already exists",user->nick,parameters[0]); } } diff --git a/src/commands/cmd_qline.cpp b/src/commands/cmd_qline.cpp index 6b0b9d2c9..8384c2ca0 100644 --- a/src/commands/cmd_qline.cpp +++ b/src/commands/cmd_qline.cpp @@ -36,7 +36,8 @@ CmdResult CommandQline::Handle (const char** parameters, int pcnt, User *user) } long duration = ServerInstance->Duration(parameters[1]); - if (ServerInstance->XLines->AddQLine(duration,user->nick,parameters[2],parameters[0])) + QLine* ql = new QLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], parameters[0]); + if (!ServerInstance->XLines->AddLine(ql)) { FOREACH_MOD(I_OnAddQLine,OnAddQLine(duration, user, parameters[2], parameters[0])); if (!duration) @@ -53,6 +54,7 @@ CmdResult CommandQline::Handle (const char** parameters, int pcnt, User *user) } else { + delete ql; user->WriteServ("NOTICE %s :*** Q-Line for %s already exists",user->nick,parameters[0]); } } diff --git a/src/commands/cmd_zline.cpp b/src/commands/cmd_zline.cpp index 95063c8e2..971961c57 100644 --- a/src/commands/cmd_zline.cpp +++ b/src/commands/cmd_zline.cpp @@ -36,7 +36,16 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user) return CMD_FAILURE; long duration = ServerInstance->Duration(parameters[1]); - if (ServerInstance->XLines->AddZLine(duration,user->nick,parameters[2],parameters[0])) + + const char* ipaddr = parameters[0]; + if (strchr(ipaddr,'@')) + { + while (*ipaddr != '@') + ipaddr++; + ipaddr++; + } + ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), duration, user->nick, parameters[2], ipaddr); + if (!ServerInstance->XLines->AddLine(zl)) { FOREACH_MOD(I_OnAddZLine,OnAddZLine(duration, user, parameters[2], parameters[0])); if (!duration) @@ -53,6 +62,7 @@ CmdResult CommandZline::Handle (const char** parameters, int pcnt, User *user) } else { + delete zl; user->WriteServ("NOTICE %s :*** Z-Line for %s already exists",user->nick,parameters[0]); } } |