X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_filter.h;h=e1f97bd72855fc15718f296a7496bca0cf490ed0;hb=52671661f8fdca0b61aec8009b4bc7de9bc00166;hp=c4d2e71ef57aa1a877126d0be2c4317c8f4640c3;hpb=5a5d59a7916cf40d71e6a312352867a489ff2a52;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index c4d2e71ef..e1f97bd72 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -36,10 +36,10 @@ class FilterResult : public classbase bool flag_privmsg; bool flag_notice; - FilterResult(const std::string free, const std::string &rea, const std::string &act, long gt, const std::string &fla) : freeform(free), reason(rea), - action(act), gline_time(gt), flags(fla) + FilterResult(const std::string free, const std::string &rea, const std::string &act, long gt, const std::string &fla) : + freeform(free), reason(rea), action(act), gline_time(gt), flags(fla) { - this->FillFlags(flags); + this->FillFlags(fla); } int FillFlags(const std::string &fl) @@ -113,7 +113,7 @@ protected: 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); virtual int OnStats(char symbol, User* user, string_list &results) = 0; - virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line); + virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line); bool AppliesToMe(User* user, FilterResult* filter, int flags); }; @@ -121,13 +121,13 @@ class CommandFilter : public Command { FilterBase* Base; public: - CommandFilter(FilterBase* f, InspIRCd* Me, const std::string &source) : Command(Me, "FILTER", 'o', 1), Base(f) + CommandFilter(FilterBase* f, InspIRCd* Me, const std::string &ssource) : Command(Me, "FILTER", "o", 1), Base(f) { - this->source = source; + this->source = ssource; this->syntax = " [] :"; } - CmdResult Handle(const char** parameters, int pcnt, User *user) + CmdResult Handle(const char* const* parameters, int pcnt, User *user) { if (pcnt == 1) { @@ -207,17 +207,17 @@ class CommandFilter : public Command } }; -bool FilterBase::AppliesToMe(User* user, FilterResult* filter, int flags) +bool FilterBase::AppliesToMe(User* user, FilterResult* filter, int iflags) { if ((filter->flag_no_opers) && IS_OPER(user)) return false; - if ((flags & FLAG_PRIVMSG) && (!filter->flag_privmsg)) + if ((iflags & FLAG_PRIVMSG) && (!filter->flag_privmsg)) return false; - if ((flags & FLAG_NOTICE) && (!filter->flag_notice)) + if ((iflags & FLAG_NOTICE) && (!filter->flag_notice)) return false; - if ((flags & FLAG_QUIT) && (!filter->flag_quit_message)) + if ((iflags & FLAG_QUIT) && (!filter->flag_quit_message)) return false; - if ((flags & FLAG_PART) && (!filter->flag_part_message)) + if ((iflags & FLAG_PART) && (!filter->flag_part_message)) return false; return true; } @@ -289,13 +289,13 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri delete gl; } - ServerInstance->Log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their message filtered, target was ")+target+": "+f->reason+" Action: "+f->action); + ServerInstance->Logs->Log("FILTER",DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their message filtered, target was ")+target+": "+f->reason+" Action: "+f->action); return 1; } return 0; } -int FilterBase::OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line) +int FilterBase::OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line) { flags = 0; if ((validated == 1) && (IS_LOCAL(user))) @@ -388,7 +388,7 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters void FilterBase::OnRehash(User* user, const std::string ¶meter) { ConfigReader* MyConf = new ConfigReader(ServerInstance); - vector().swap(exemptfromfilter); + std::vector().swap(exemptfromfilter); for (int index = 0; index < MyConf->Enumerate("exemptfromfilter"); ++index) { std::string chan = MyConf->ReadValue("exemptfromfilter", "channel", index);