X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanfilter.cpp;h=31a30de0e7933bfa55235c2d2275002ddc9fd158;hb=fea1a27cb96a114f698eedcf90401b78406108fb;hp=0ea3ca064511225e83370cf220d4bf907fd27e76;hpb=f16ef27e0e5df0249ecb38f7adf76735a550ad0a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 0ea3ca064..31a30de0e 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -37,7 +37,7 @@ class ChanFilter : public ListModeBase { if (word.length() > 35) { - WriteServ(user->fd, "935 %s %s %s :word is too long for censor list",user->nick, chan->name,word.c_str()); + user->WriteServ( "935 %s %s %s :word is too long for censor list",user->nick, chan->name,word.c_str()); return false; } @@ -46,18 +46,18 @@ class ChanFilter : public ListModeBase virtual bool TellListTooLong(userrec* user, chanrec* chan, std::string &word) { - WriteServ(user->fd,"939 %s %s %s :Channel spamfilter list is full",user->nick, chan->name, word.c_str()); + user->WriteServ("939 %s %s %s :Channel spamfilter list is full",user->nick, chan->name, word.c_str()); return true; } virtual void TellAlreadyOnList(userrec* user, chanrec* chan, std::string &word) { - WriteServ(user->fd,"937 %s %s :The word %s is already on the spamfilter list",user->nick, chan->name,word.c_str()); + user->WriteServ("937 %s %s :The word %s is already on the spamfilter list",user->nick, chan->name,word.c_str()); } virtual void TellNotSet(userrec* user, chanrec* chan, std::string &word) { - WriteServ(user->fd,"938 %s %s :No such spamfilter word is set",user->nick, chan->name); + user->WriteServ("938 %s %s :No such spamfilter word is set",user->nick, chan->name); } }; @@ -101,7 +101,8 @@ class ModuleChanFilter : public Module // Create a copy of the string in irc::string irc::string line = text.c_str(); - modelist* list = (modelist*)chan->GetExt(cf->GetInfoKey()); + modelist* list; + chan->GetExt(cf->GetInfoKey(), list); if (list) { @@ -109,7 +110,7 @@ class ModuleChanFilter : public Module { if (line.find(i->mask.c_str()) != std::string::npos) { - WriteServ(user->fd,"936 %s %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name, i->mask.c_str()); + user->WriteServ("936 %s %s %s :Your message contained a censored word, and was blocked",user->nick, chan->name, i->mask.c_str()); return 1; } }