From bd4c18aa1554e4fec0913b3c5f742080cbf0eab4 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 7 Apr 2004 16:33:24 +0000 Subject: Added servernotice back to the user, informing them Added support for NULL as first parameter to Server::SendTo git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@418 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_filter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index d2714ee01..d208e7a5a 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -55,6 +55,7 @@ class ModuleFilter : public Module if (Srv->MatchText(text,pattern)) { std::string target = ""; + std::string reason = MyConf->ReadValue("keyword","reason",index); if (target_type == TYPE_USER) { userrec* t = (userrec*)dest; @@ -67,10 +68,13 @@ class ModuleFilter : public Module } Srv->SendOpers(std::string("FILTER: ")+std::string(user->nick)+ std::string(" had their message filtered, target was ")+ - target+": "+MyConf->ReadValue("keyword","reason",index)); + target+": "+reason); Srv->Log(DEFAULT,std::string("FILTER: ")+std::string(user->nick)+ std::string(" had their message filtered, target was ")+ - target+": "+MyConf->ReadValue("keyword","reason",index)); + target+": "+reason); + // this form of SendTo (with the source as NuLL) sends a server notice + Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+ + " :Your message has been filtered and opers notified: "+reason); return 1; } } @@ -86,6 +90,7 @@ class ModuleFilter : public Module if (Srv->MatchText(text,pattern)) { std::string target = ""; + std::string reason = MyConf->ReadValue("keyword","reason",index); if (target_type == TYPE_USER) { userrec* t = (userrec*)dest; @@ -102,6 +107,8 @@ class ModuleFilter : public Module Srv->Log(DEFAULT,std::string("FILTER: ")+std::string(user->nick)+ std::string(" had their notice filtered, target was ")+ target+": "+MyConf->ReadValue("keyword","reason",index)); + Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+ + " :Your notice has been filtered and opers notified: "+reason); return 1; } } -- cgit v1.2.3