From 792c2dafc0ab0d982f9912fb7fe18cfbe2c64946 Mon Sep 17 00:00:00 2001 From: om Date: Thu, 10 Aug 2006 16:00:03 +0000 Subject: Fix to new API git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4840 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_filter_pcre.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp index 08068db59..891b550ff 100644 --- a/src/modules/extra/m_filter_pcre.cpp +++ b/src/modules/extra/m_filter_pcre.cpp @@ -116,7 +116,7 @@ class ModuleFilterPCRE : public Module { if (pcre_exec(filters[index],NULL,text.c_str(),text.length(),0,0,NULL,0) > -1) { - std::string target = ""; + const char* target; std::string reason = MyConf->ReadValue("keyword","reason",index); std::string do_action = MyConf->ReadValue("keyword","action",index); @@ -126,24 +126,25 @@ class ModuleFilterPCRE : public Module if (target_type == TYPE_USER) { userrec* t = (userrec*)dest; - target = std::string(t->nick); + target = t->nick; } else if (target_type == TYPE_CHANNEL) { chanrec* t = (chanrec*)dest; - target = std::string(t->name); + target = t->name; } + else + { + target = ""; + } + if (do_action == "block") - { - Srv->SendOpers(std::string("Filter: ")+std::string(user->nick)+ - std::string(" had their notice filtered, target was ")+ - target+": "+reason); - user->WriteServ("NOTICE "+std::string(user->nick)+ - " :Your notice has been filtered and opers notified: "+reason); - } - Srv->Log(DEFAULT,std::string("Filter: ")+std::string(user->nick)+ - std::string(" had their notice filtered, target was ")+ - target+": "+reason+" Action: "+do_action); + { + ServerInstance->WriteOpers("Filter: %s had their notice filtered, target was %s: %s", user->nick, target, reason.c_str()); + user->WriteServ("NOTICE "+std::string(user->nick)+" :Your notice has been filtered and opers notified: "+reason); + } + + log(DEFAULT, "Filter: %s had their notice filtered, target was %s: %s Action: %s", user->nick, target, reason.c_str(), do_action.c_str()); if (do_action == "kill") { @@ -225,4 +226,3 @@ extern "C" void * init_module( void ) { return new ModuleFilterPCREFactory; } - -- cgit v1.2.3