|
|||
|
|||
|
#include <m_filter.h>
Inheritance diagram for FilterBase:


Public Member Functions | |
| FilterBase (InspIRCd *Me, const std::string &source) | |
| virtual | ~FilterBase () |
| virtual int | OnUserPreMessage (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list) |
| Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. | |
| virtual FilterResult * | FilterMatch (User *user, const std::string &text, int flags)=0 |
| virtual bool | DeleteFilter (const std::string &freeform)=0 |
| virtual void | SyncFilters (Module *proto, void *opaque)=0 |
| virtual void | SendFilter (Module *proto, void *opaque, FilterResult *iter) |
| virtual std::pair< bool, std::string > | AddFilter (const std::string &freeform, const std::string &type, const std::string &reason, long duration, const std::string &flags)=0 |
| virtual int | OnUserPreNotice (User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list) |
| Called whenever a user is about to NOTICE A user or a channel, before any processing is done. | |
| virtual void | OnRehash (User *user, const std::string ¶meter) |
| Called on rehash. | |
| virtual Version | GetVersion () |
| Returns the version number of a Module. | |
| std::string | EncodeFilter (FilterResult *filter) |
| FilterResult | DecodeFilter (const std::string &data) |
| virtual void | OnSyncOtherMetaData (Module *proto, void *opaque, bool displayable=false) |
| virtual void | OnDecodeMetaData (int target_type, void *target, const std::string &extname, const std::string &extdata) |
| Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. | |
| virtual int | OnStats (char symbol, User *user, string_list &results)=0 |
| Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core. | |
| virtual int | OnPreCommand (std::string &command, std::vector< std::string > ¶meters, User *user, bool validated, const std::string &original_line) |
| Called whenever any command is about to be executed. | |
| bool | AppliesToMe (User *user, FilterResult *filter, int flags) |
Protected Attributes | |
| std::vector< std::string > | exemptfromfilter |
Private Attributes | |
| CommandFilter * | filtcommand |
| int | flags |
Definition at line 93 of file m_filter.h.
|
||||||||||||
|
Definition at line 225 of file m_filter.h. References InspIRCd::AddCommand(), ModuleManager::Attach(), filtcommand, I_OnDecodeMetaData, I_OnPreCommand, I_OnRehash, I_OnStats, I_OnSyncOtherMetaData, I_OnUserPreMessage, I_OnUserPreNotice, InspIRCd::Modules, and Module::ServerInstance. |
|
|
Definition at line 233 of file m_filter.h. |
|
||||||||||||||||||||||||
|
Implemented in ModuleFilter, and ModuleFilterPCRE. Referenced by CommandFilter::Handle(), and OnDecodeMetaData(). |
|
||||||||||||||||
|
Definition at line 210 of file m_filter.h. References FilterResult::flag_no_opers, FilterResult::flag_notice, FLAG_NOTICE, FLAG_PART, FilterResult::flag_part_message, FilterResult::flag_privmsg, FLAG_PRIVMSG, FLAG_QUIT, FilterResult::flag_quit_message, and IS_OPER. Referenced by ModuleFilterPCRE::FilterMatch(), and ModuleFilter::FilterMatch(). |
|
|
Definition at line 422 of file m_filter.h. References FilterResult::action, FilterResult::FillFlags(), FilterResult::flags, FilterResult::freeform, irc::tokenstream::GetToken(), FilterResult::gline_time, and FilterResult::reason. Referenced by OnDecodeMetaData(). |
|
|
Implemented in ModuleFilter, and ModuleFilterPCRE. Referenced by CommandFilter::Handle(). |
|
|
Definition at line 408 of file m_filter.h. References FilterResult::action, FilterResult::flags, FilterResult::freeform, FilterResult::gline_time, and FilterResult::reason. Referenced by SendFilter(). |
|
||||||||||||||||
|
Implemented in ModuleFilter, and ModuleFilterPCRE. Referenced by OnPreCommand(), and OnUserPreNotice(). |
|
|
Returns the version number of a Module. The method should return a Version object with its version information assigned via Version::Version Reimplemented from Module. Definition at line 402 of file m_filter.h. References API_VERSION, VF_COMMON, and VF_VENDOR. |
|
||||||||||||||||||||
|
Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. Please see src/modules/m_swhois.cpp for a working example of how to use this method call.
Reimplemented from Module. Definition at line 453 of file m_filter.h. References FilterResult::action, AddFilter(), DecodeFilter(), FilterResult::flags, FilterResult::freeform, FilterResult::gline_time, FilterResult::reason, and TYPE_OTHER. |
|
||||||||||||||||||||||||
|
Called whenever any command is about to be executed. This event occurs for all registered commands, wether they are registered in the core, or another module, and for invalid commands. Invalid commands may only be sent to this function when the value of validated is false. By returning 1 from this method you may prevent the command being executed. If you do this, no output is created by the core, and it is down to your module to produce any output neccessary. Note that unless you return 1, you should not destroy any structures (e.g. by using InspIRCd::QuitUser) otherwise when the command's handler function executes after your method returns, it will be passed an invalid pointer to the user object and crash!)
Reimplemented from Module. Definition at line 298 of file m_filter.h. References FilterResult::action, XLineManager::AddLine(), XLineManager::ApplyLines(), InspIRCd::Config, exemptfromfilter, FilterMatch(), FLAG_PART, FLAG_QUIT, flags, CommandParser::GetHandler(), User::GetIPString(), FilterResult::gline_time, Command::Handle(), IS_LOCAL, User::nick, InspIRCd::Parser, UserManager::QuitUser(), FilterResult::reason, Module::ServerInstance, ServerConfig::ServerName, InspIRCd::Time(), InspIRCd::Users, User::WriteServ(), and InspIRCd::XLines. |
|
||||||||||||
|
Called on rehash. This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.
Reimplemented from Module. Reimplemented in ModuleFilter, and ModuleFilterPCRE. Definition at line 388 of file m_filter.h. References exemptfromfilter, ConfigReader::ReadValue(), and Module::ServerInstance. Referenced by ModuleFilterPCRE::OnRehash(), and ModuleFilter::OnRehash(). |
|
||||||||||||||||
|
Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core.
Reimplemented from Module. Implemented in ModuleFilter, and ModuleFilterPCRE. |
|
||||||||||||||||
|
Reimplemented from Module. Definition at line 443 of file m_filter.h. References SyncFilters(). |
|
||||||||||||||||||||||||||||
|
Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details of where the message is destined to be sent.
Reimplemented from Module. Definition at line 237 of file m_filter.h. References FLAG_PRIVMSG, flags, and OnUserPreNotice(). |
|
||||||||||||||||||||||||||||
|
Called whenever a user is about to NOTICE A user or a channel, before any processing is done. Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a User* otherwise you must cast it to a Channel*, this is the details of where the message is destined to be sent. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers.
Reimplemented from Module. Definition at line 243 of file m_filter.h. References FilterResult::action, XLineManager::AddLine(), XLineManager::ApplyLines(), InspIRCd::Config, DEFAULT, exemptfromfilter, FilterMatch(), FLAG_NOTICE, flags, User::GetIPString(), FilterResult::gline_time, IS_LOCAL, LogManager::Log(), InspIRCd::Logs, Channel::name, User::nick, UserManager::QuitUser(), FilterResult::reason, User::server, Module::ServerInstance, ServerConfig::ServerName, InspIRCd::SNO, InspIRCd::Time(), TYPE_CHANNEL, TYPE_USER, InspIRCd::ULine(), InspIRCd::Users, User::WriteServ(), SnomaskManager::WriteToSnoMask(), and InspIRCd::XLines. Referenced by OnUserPreMessage(). |
|
||||||||||||||||
|
Definition at line 448 of file m_filter.h. References EncodeFilter(), Module::ProtoSendMetaData(), and TYPE_OTHER. Referenced by ModuleFilterPCRE::SyncFilters(), and ModuleFilter::SyncFilters(). |
|
||||||||||||
|
Implemented in ModuleFilter, and ModuleFilterPCRE. Referenced by OnSyncOtherMetaData(). |
|
|
Definition at line 98 of file m_filter.h. Referenced by OnPreCommand(), OnRehash(), ModuleFilterPCRE::OnStats(), and OnUserPreNotice(). |
|
|
Definition at line 95 of file m_filter.h. Referenced by FilterBase(). |
|
|
Definition at line 96 of file m_filter.h. Referenced by OnPreCommand(), OnUserPreMessage(), and OnUserPreNotice(). |