summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 16:00:03 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 16:00:03 +0000
commit792c2dafc0ab0d982f9912fb7fe18cfbe2c64946 (patch)
tree6c6c1e8eaa68e91671f50e29b3dd569f025517d9 /src/modules
parent7fc4b79abc5e8aebe6b52eb8b984aa2f3e689d4a (diff)
Fix to new API
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4840 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_filter_pcre.cpp28
1 files changed, 14 insertions, 14 deletions
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;
}
-