public:
- ModuleChanFilter()
+ ModuleChanFilter(Server* Me)
+ : Module::Module(Me)
{
- Srv = new Server;
+ Srv = Me;
Conf = new ConfigReader;
Srv->AddExtendedListMode('g');
MaxEntries = Conf->ReadInteger("chanfilter","maxsize",0,true);
+ if (MaxEntries == 0)
+ MaxEntries = 32;
}
virtual void On005Numeric(std::string &output)
{
for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++)
{
- if (strstr(text.c_str(),i->c_str()))
+ if (strstr(buffer,i->c_str()))
{
WriteServ(user->fd,"936 %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name);
return 1;
virtual ~ModuleChanFilter()
{
delete Conf;
- delete Srv;
}
virtual Version GetVersion()
return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
}
- virtual string_list OnChannelSync(chanrec* chan)
+ virtual void OnSyncChannel(chanrec* chan, Module* proto, void* opaque)
{
SpamList* spamlist = (SpamList*)chan->GetExt("spam_list");
string_list commands;
{
for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++)
{
- commands.push_back("M "+std::string(chan->name)+" +g "+*i);
+ proto->ProtoSendMode(opaque,TYPE_CHANNEL,chan,"+g "+*i);
}
}
- return commands;
}
};
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleChanFilter;
+ return new ModuleChanFilter(Me);
}
};