From de08da58f7a8af9f0fae1b98aeee1dfb10fb06fe Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 31 Oct 2007 17:57:57 +0000 Subject: Bloody hell, just how many modules use this shit git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8433 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_dnsbl.cpp | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 3c2d18e75..b2fb04dd1 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -113,28 +113,41 @@ class DNSBLResolver : public Resolver } case DNSBLConfEntry::I_KLINE: { - std::string ban = std::string("*@") + them->GetIPString(); - if (show) - ServerInstance->XLines->ApplyLines(); - show = ServerInstance->XLines->AddKLine(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), ban.c_str()); - FOREACH_MOD(I_OnAddKLine,OnAddKLine(ConfEntry->duration, NULL, reason, ban)); + KLine* kl = new KLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), + "*", them->GetIPString()); + if (ServerInstance->XLines->AddLine(kl)) + { + ServerInstance->XLines->ApplyLines(); + FOREACH_MOD(I_OnAddKLine,OnAddKLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + } + else + delete kl; break; } case DNSBLConfEntry::I_GLINE: { - std::string ban = std::string("*@") + them->GetIPString(); - show = ServerInstance->XLines->AddGLine(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), ban.c_str()); - if (show) + GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), + "*", them->GetIPString()); + if (ServerInstance->XLines->AddLine(gl)) + { ServerInstance->XLines->ApplyLines(); - FOREACH_MOD(I_OnAddGLine,OnAddGLine(ConfEntry->duration, NULL, reason, ban)); + FOREACH_MOD(I_OnAddGLine,OnAddGLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + } + else + delete gl; break; } case DNSBLConfEntry::I_ZLINE: { - show = ServerInstance->XLines->AddZLine(ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), them->GetIPString()); - if (show) + ZLine* zl = new ZLine(ServerInstance, ServerInstance->Time(), ConfEntry->duration, ServerInstance->Config->ServerName, reason.c_str(), + them->GetIPString()); + if (ServerInstance->XLines->AddLine(zl)) + { ServerInstance->XLines->ApplyLines(); - FOREACH_MOD(I_OnAddZLine,OnAddZLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + FOREACH_MOD(I_OnAddZLine,OnAddZLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + } + else + delete zl; break; } case DNSBLConfEntry::I_UNKNOWN: -- cgit v1.2.3