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)
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);
};
{
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 = "<filter-definition> <type> <flags> [<gline-duration>] :<reason>";
}
- CmdResult Handle(const char** parameters, int pcnt, User *user)
+ CmdResult Handle(const char* const* parameters, int pcnt, User *user)
{
if (pcnt == 1)
{
}
};
-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;
}
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)))