- virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
- {
- if ((modechar == 'g') && (type == MT_CHANNEL))
- {
- chanrec* chan = (chanrec*)target;
- std::string param = params[0];
-
- if (mode_on)
- {
- SpamList* spamlist = (SpamList*)chan->GetExt("spam_list");
- if (!spamlist)
- {
- spamlist = new SpamList;
- chan->Extend("spam_list",(char*)spamlist);
- }
- if (spamlist->size() < MaxEntries)
- {
- for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++)
- {
- if (*i == params[0])
- {
- WriteServ(user->fd,"937 %s %s :The word %s is already on the spamfilter list",user->nick, chan->name,params[0].c_str());
- return -1;
- }
- }
- spamlist->push_back(params[0]);
- return 1;
- }
- WriteServ(user->fd,"939 %s %s :Channel spamfilter list is full",user->nick, chan->name);
- return -1;
- }
- else
- {
- SpamList* spamlist = (SpamList*)chan->GetExt("spam_list");
- if (spamlist)
- {
- for (SpamList::iterator i = spamlist->begin(); i != spamlist->end(); i++)
- {
- if (*i == params[0])
- {
- spamlist->erase(i);
- return 1;
- }
- }
- }
- WriteServ(user->fd,"938 %s %s :No such spamfilter word is set",user->nick, chan->name);
- return -1;
- }
- return -1;
- }
- return 0;
- }
-
- virtual void OnSendList(userrec* user, chanrec* channel, char mode)
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)