*/
-/* $ModDesc: Provides user and channel +G mode */
-
#define _CRT_SECURE_NO_DEPRECATE
#define _SCL_SECURE_NO_DEPRECATE
public:
ModuleCensor() : cu(this), cc(this) { }
- void init() CXX11_OVERRIDE
- {
- /* Read the configuration file on startup.
- */
- OnRehash(NULL);
- ServerInstance->Modules->AddService(cu);
- ServerInstance->Modules->AddService(cc);
- Implementation eventlist[] = { I_OnRehash, I_OnUserPreMessage, I_OnUserPreNotice };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
- }
-
// format of a config entry is <badword text="shit" replace="poo">
- ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) CXX11_OVERRIDE
+ ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE
{
if (!IS_LOCAL(user))
return MOD_RES_PASSTHRU;
bool active = false;
if (target_type == TYPE_USER)
- active = ((User*)dest)->IsModeSet('G');
+ active = ((User*)dest)->IsModeSet(cu);
else if (target_type == TYPE_CHANNEL)
{
- active = ((Channel*)dest)->IsModeSet('G');
Channel* c = (Channel*)dest;
+ active = c->IsModeSet(cc);
ModResult res = ServerInstance->OnCheckExemption(user,c,"censor");
if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
}
- ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) CXX11_OVERRIDE
- {
- return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
- }
-
- void OnRehash(User* user) CXX11_OVERRIDE
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
/*
* reload our config file on rehash - we must destroy and re-allocate the classes