From ca7cb01b7a286f346748986da74b634edfe195c7 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 31 Oct 2007 18:06:54 +0000 Subject: This one too, grr git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8434 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_dnsbl.cpp | 4 ++-- src/modules/m_filter.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index b2fb04dd1..cd37b6895 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -118,7 +118,7 @@ class DNSBLResolver : public Resolver if (ServerInstance->XLines->AddLine(kl)) { ServerInstance->XLines->ApplyLines(); - FOREACH_MOD(I_OnAddKLine,OnAddKLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + FOREACH_MOD(I_OnAddKLine,OnAddKLine(ConfEntry->duration, NULL, reason, them->MakeHostIP())); } else delete kl; @@ -131,7 +131,7 @@ class DNSBLResolver : public Resolver if (ServerInstance->XLines->AddLine(gl)) { ServerInstance->XLines->ApplyLines(); - FOREACH_MOD(I_OnAddGLine,OnAddGLine(ConfEntry->duration, NULL, reason, them->GetIPString())); + FOREACH_MOD(I_OnAddGLine,OnAddGLine(ConfEntry->duration, NULL, reason, them->MakeHostIP())); } else delete gl; diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index 1b65623c5..fc0d97938 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -280,11 +280,14 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri } if (f->action == "gline") { - if (ServerInstance->XLines->AddGLine(f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), user->MakeHostIP())) + GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString()); + if (ServerInstance->XLines->AddLine(gl)) { ServerInstance->XLines->ApplyLines(); FOREACH_MOD(I_OnAddGLine,OnAddGLine(f->gline_time, NULL, f->reason, user->MakeHostIP())); } + else + delete gl; } ServerInstance->Log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their message filtered, target was ")+target+": "+f->reason+" Action: "+f->action); @@ -365,14 +368,14 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters if (f->action == "gline") { /* Note: We gline *@IP so that if their host doesnt resolve the gline still applies. */ - std::string wild = "*@"; - wild.append(user->GetIPString()); - - if (ServerInstance->XLines->AddGLine(f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), wild.c_str())) + GLine* gl = new GLine(ServerInstance, ServerInstance->Time(), f->gline_time, ServerInstance->Config->ServerName, f->reason.c_str(), "*", user->GetIPString()); + if (ServerInstance->XLines->AddLine(gl)) { ServerInstance->XLines->ApplyLines(); FOREACH_MOD(I_OnAddGLine,OnAddGLine(f->gline_time, NULL, f->reason, user->MakeHostIP())); } + else + delete gl; } return 1; } -- cgit v1.2.3