- text = text + " ";
- for (int index = 0; index < MyConf->Enumerate("keyword"); index++)
- {
- std::string pattern = MyConf->ReadValue("keyword","pattern",index);
- if (Srv->MatchText(text,pattern))
- {
- std::string target = "";
- if (target_type == TYPE_USER)
- {
- userrec* t = (userrec*)dest;
- target = std::string(t->nick);
- }
- else if (target_type == TYPE_CHANNEL)
- {
- chanrec* t = (chanrec*)dest;
- target = std::string(t->name);
- }
- Srv->SendOpers(std::string("FILTER: ")+std::string(user->nick)+
- std::string(" had their message filtered, target was ")+
- target+": "+MyConf->ReadValue("keyword","reason",index));
- Srv->Log(DEFAULT,std::string("FILTER: ")+std::string(user->nick)+
- std::string(" had their message filtered, target was ")+
- target+": "+MyConf->ReadValue("keyword","reason",index));
- return 1;
- }
- }
- return 0;
+ return OnUserPreNotice(user,dest,target_type,text,status);