diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-07 16:33:24 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-07 16:33:24 +0000 |
commit | bd4c18aa1554e4fec0913b3c5f742080cbf0eab4 (patch) | |
tree | 3f76c99a25742ac77b86d252228e0728b352f11f /src/modules | |
parent | 78cd2581e957e05246029b76c2da4ca1261d7d3f (diff) |
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
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_filter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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; } } |