2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2004, 2008 Craig Edwards <craigedwards@brainbox.cc>
6 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
7 * Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
9 * This file is part of InspIRCd. InspIRCd is free software: you can
10 * redistribute it and/or modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation, version 2.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "modules/regex.h"
26 #include "modules/server.h"
27 #include "modules/shun.h"
28 #include "modules/stats.h"
61 bool flag_part_message;
62 bool flag_quit_message;
65 bool flag_strip_color;
67 FilterResult(dynamic_reference<RegexFactory>& RegexEngine, const std::string& free, const std::string& rea, FilterAction act, long gt, const std::string& fla, bool cfg)
75 throw ModuleException("Regex module implementing '"+RegexEngine.GetProvider()+"' is not loaded!");
76 regex = RegexEngine->Create(free);
80 char FillFlags(const std::string &fl)
82 flag_no_opers = flag_part_message = flag_quit_message = flag_privmsg =
83 flag_notice = flag_strip_color = false;
85 for (std::string::const_iterator n = fl.begin(); n != fl.end(); ++n)
93 flag_part_message = true;
96 flag_quit_message = true;
105 flag_strip_color = true;
108 flag_no_opers = flag_part_message = flag_quit_message =
109 flag_privmsg = flag_notice = flag_strip_color = true;
119 std::string GetFlags()
123 flags.push_back('o');
124 if (flag_part_message)
125 flags.push_back('P');
126 if (flag_quit_message)
127 flags.push_back('q');
129 flags.push_back('p');
131 flags.push_back('n');
133 /* Order is important here, 'c' must be the last char in the string as it is unsupported
134 * on < 2.0.10, and the logic in FillFlags() stops parsing when it ecounters an unknown
137 if (flag_strip_color)
138 flags.push_back('c');
141 flags.push_back('-');
151 class CommandFilter : public Command
154 CommandFilter(Module* f)
155 : Command(f, "FILTER", 1, 5)
158 this->syntax = "<filter-definition> <action> <flags> [<duration>] :<reason>";
160 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
162 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE
164 return ROUTE_BROADCAST;
168 class ModuleFilter : public Module, public ServerEventListener, public Stats::EventListener
170 typedef insp::flat_set<std::string, irc::insensitive_swo> ExemptTargetSet;
174 RegexFactory* factory;
178 CommandFilter filtcommand;
179 dynamic_reference<RegexFactory> RegexEngine;
181 std::vector<FilterResult> filters;
184 // List of channel names excluded from filtering.
185 ExemptTargetSet exemptedchans;
187 // List of target nicknames excluded from filtering.
188 ExemptTargetSet exemptednicks;
191 void init() CXX11_OVERRIDE;
192 CullResult cull() CXX11_OVERRIDE;
193 ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE;
194 FilterResult* FilterMatch(User* user, const std::string &text, int flags);
195 bool DeleteFilter(const std::string &freeform);
196 std::pair<bool, std::string> AddFilter(const std::string &freeform, FilterAction type, const std::string &reason, long duration, const std::string &flags);
197 void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE;
198 Version GetVersion() CXX11_OVERRIDE;
199 std::string EncodeFilter(FilterResult* filter);
200 FilterResult DecodeFilter(const std::string &data);
201 void OnSyncNetwork(ProtocolInterface::Server& server) CXX11_OVERRIDE;
202 void OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata) CXX11_OVERRIDE;
203 ModResult OnStats(Stats::Context& stats) CXX11_OVERRIDE;
204 ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) CXX11_OVERRIDE;
205 void OnUnloadModule(Module* mod) CXX11_OVERRIDE;
206 bool AppliesToMe(User* user, FilterResult* filter, int flags);
208 static bool StringToFilterAction(const std::string& str, FilterAction& fa);
209 static std::string FilterActionToString(FilterAction fa);
212 CmdResult CommandFilter::Handle(User* user, const Params& parameters)
214 if (parameters.size() == 1)
216 /* Deleting a filter */
217 Module *me = creator;
218 if (static_cast<ModuleFilter *>(me)->DeleteFilter(parameters[0]))
220 user->WriteNotice("*** Removed filter '" + parameters[0] + "'");
221 ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'f' : 'F', "FILTER: "+user->nick+" removed filter '"+parameters[0]+"'");
226 user->WriteNotice("*** Filter '" + parameters[0] + "' not found in list, try /stats s.");
232 /* Adding a filter */
233 if (parameters.size() >= 4)
235 const std::string& freeform = parameters[0];
237 const std::string& flags = parameters[2];
238 unsigned int reasonindex;
241 if (!ModuleFilter::StringToFilterAction(parameters[1], type))
243 if (ServerInstance->XLines->GetFactory("SHUN"))
244 user->WriteNotice("*** Invalid filter type '" + parameters[1] + "'. Supported types are 'gline', 'zline', 'none', 'warn', 'block', 'silent', 'kill', and 'shun'.");
246 user->WriteNotice("*** Invalid filter type '" + parameters[1] + "'. Supported types are 'gline', 'zline', 'none', 'warn', 'block', 'silent', and 'kill'.");
250 if (type == FA_GLINE || type == FA_ZLINE || type == FA_SHUN)
252 if (parameters.size() >= 5)
254 duration = InspIRCd::Duration(parameters[3]);
259 user->WriteNotice("*** Not enough parameters: When setting a '" + parameters[1] + "' type filter, a duration must be specified as the third parameter.");
268 Module *me = creator;
269 std::pair<bool, std::string> result = static_cast<ModuleFilter *>(me)->AddFilter(freeform, type, parameters[reasonindex], duration, flags);
272 user->WriteNotice("*** Added filter '" + freeform + "', type '" + parameters[1] + "'" +
273 (duration ? ", duration " + parameters[3] : "") + ", flags '" + flags + "', reason: '" +
274 parameters[reasonindex] + "'");
276 ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'f' : 'F', "FILTER: "+user->nick+" added filter '"+freeform+"', type '"+parameters[1]+"', "+(duration ? "duration "+parameters[3]+", " : "")+"flags '"+flags+"', reason: "+parameters[reasonindex]);
282 user->WriteNotice("*** Filter '" + freeform + "' could not be added: " + result.second);
288 user->WriteNotice("*** Not enough parameters.");
295 bool ModuleFilter::AppliesToMe(User* user, FilterResult* filter, int iflags)
297 if ((filter->flag_no_opers) && user->IsOper())
299 if ((iflags & FLAG_PRIVMSG) && (!filter->flag_privmsg))
301 if ((iflags & FLAG_NOTICE) && (!filter->flag_notice))
303 if ((iflags & FLAG_QUIT) && (!filter->flag_quit_message))
305 if ((iflags & FLAG_PART) && (!filter->flag_part_message))
310 ModuleFilter::ModuleFilter()
311 : ServerEventListener(this)
312 , Stats::EventListener(this)
315 , RegexEngine(this, "regex")
319 void ModuleFilter::init()
321 ServerInstance->SNO->EnableSnomask('f', "FILTER");
324 CullResult ModuleFilter::cull()
327 return Module::cull();
330 void ModuleFilter::FreeFilters()
332 for (std::vector<FilterResult>::const_iterator i = filters.begin(); i != filters.end(); ++i)
338 ModResult ModuleFilter::OnUserPreMessage(User* user, const MessageTarget& msgtarget, MessageDetails& details)
340 // Leave remote users and servers alone
342 return MOD_RES_PASSTHRU;
344 flags = (details.type == MSG_PRIVMSG) ? FLAG_PRIVMSG : FLAG_NOTICE;
346 FilterResult* f = this->FilterMatch(user, details.text, flags);
350 if (msgtarget.type == MessageTarget::TYPE_USER)
352 User* t = msgtarget.Get<User>();
353 // Check if the target nick is exempted, if yes, ignore this message
354 if (exemptednicks.count(t->nick))
355 return MOD_RES_PASSTHRU;
359 else if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
361 Channel* t = msgtarget.Get<Channel>();
362 if (exemptedchans.count(t->name))
363 return MOD_RES_PASSTHRU;
367 if (f->action == FA_WARN)
369 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("WARNING: %s's message to %s matched %s (%s)",
370 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
371 return MOD_RES_PASSTHRU;
373 if (f->action == FA_BLOCK)
375 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s had their message to %s filtered as it matched %s (%s)",
376 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
379 if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
380 user->WriteNumeric(ERR_CANNOTSENDTOCHAN, target, InspIRCd::Format("Message to channel blocked and opers notified (%s)", f->reason.c_str()));
382 user->WriteNotice("Your message to "+target+" was blocked and opers notified: "+f->reason);
385 details.echo_original = true;
387 else if (f->action == FA_SILENT)
391 if (msgtarget.type == MessageTarget::TYPE_CHANNEL)
392 user->WriteNumeric(ERR_CANNOTSENDTOCHAN, target, InspIRCd::Format("Message to channel blocked (%s)", f->reason.c_str()));
394 user->WriteNotice("Your message to "+target+" was blocked: "+f->reason);
397 details.echo_original = true;
399 else if (f->action == FA_KILL)
401 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was killed because their message to %s matched %s (%s)",
402 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
403 ServerInstance->Users->QuitUser(user, "Filtered: " + f->reason);
405 else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN")))
407 Shun* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
408 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was shunned because their message to %s matched %s (%s)",
409 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
410 if (ServerInstance->XLines->AddLine(sh, NULL))
412 ServerInstance->XLines->ApplyLines();
417 else if (f->action == FA_GLINE)
419 GLine* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), "*", user->GetIPString());
420 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was glined because their message to %s matched %s (%s)",
421 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
422 if (ServerInstance->XLines->AddLine(gl,NULL))
424 ServerInstance->XLines->ApplyLines();
429 else if (f->action == FA_ZLINE)
431 ZLine* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
432 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was zlined because their message to %s matched %s (%s)",
433 user->nick.c_str(), target.c_str(), f->freeform.c_str(), f->reason.c_str()));
434 if (ServerInstance->XLines->AddLine(zl,NULL))
436 ServerInstance->XLines->ApplyLines();
442 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, user->nick + " had their message filtered, target was " + target + ": " + f->reason + " Action: " + ModuleFilter::FilterActionToString(f->action));
445 return MOD_RES_PASSTHRU;
448 ModResult ModuleFilter::OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated)
455 if (command == "QUIT")
457 /* QUIT with no reason: nothing to do */
458 if (parameters.size() < 1)
459 return MOD_RES_PASSTHRU;
464 else if (command == "PART")
466 /* PART with no reason: nothing to do */
467 if (parameters.size() < 2)
468 return MOD_RES_PASSTHRU;
470 if (exemptedchans.count(parameters[0]))
471 return MOD_RES_PASSTHRU;
477 /* We're only messing with PART and QUIT */
478 return MOD_RES_PASSTHRU;
480 FilterResult* f = this->FilterMatch(user, parameters[parting ? 1 : 0], flags);
482 /* PART or QUIT reason doesnt match a filter */
483 return MOD_RES_PASSTHRU;
485 /* We cant block a part or quit, so instead we change the reason to 'Reason filtered' */
486 parameters[parting ? 1 : 0] = "Reason filtered";
488 /* We're warning or blocking, OR theyre quitting and its a KILL action
489 * (we cant kill someone whos already quitting, so filter them anyway)
491 if ((f->action == FA_WARN) || (f->action == FA_BLOCK) || (((!parting) && (f->action == FA_KILL))) || (f->action == FA_SILENT))
493 return MOD_RES_PASSTHRU;
497 /* Are they parting, if so, kill is applicable */
498 if ((parting) && (f->action == FA_KILL))
500 user->WriteNotice("*** Your PART message was filtered: " + f->reason);
501 ServerInstance->Users->QuitUser(user, "Filtered: " + f->reason);
503 if (f->action == FA_GLINE)
505 /* Note: We gline *@IP so that if their host doesnt resolve the gline still applies. */
506 GLine* gl = new GLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), "*", user->GetIPString());
507 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was glined because their %s message matched %s (%s)",
508 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
510 if (ServerInstance->XLines->AddLine(gl,NULL))
512 ServerInstance->XLines->ApplyLines();
517 if (f->action == FA_ZLINE)
519 ZLine* zl = new ZLine(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
520 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was zlined because their %s message matched %s (%s)",
521 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
523 if (ServerInstance->XLines->AddLine(zl,NULL))
525 ServerInstance->XLines->ApplyLines();
530 else if (f->action == FA_SHUN && (ServerInstance->XLines->GetFactory("SHUN")))
532 /* Note: We shun *!*@IP so that if their host doesnt resolve the shun still applies. */
533 Shun* sh = new Shun(ServerInstance->Time(), f->duration, ServerInstance->Config->ServerName.c_str(), f->reason.c_str(), user->GetIPString());
534 ServerInstance->SNO->WriteGlobalSno('f', InspIRCd::Format("%s was shunned because their %s message matched %s (%s)",
535 user->nick.c_str(), command.c_str(), f->freeform.c_str(), f->reason.c_str()));
536 if (ServerInstance->XLines->AddLine(sh, NULL))
538 ServerInstance->XLines->ApplyLines();
546 return MOD_RES_PASSTHRU;
549 void ModuleFilter::ReadConfig(ConfigStatus& status)
551 ConfigTagList tags = ServerInstance->Config->ConfTags("exemptfromfilter");
552 exemptedchans.clear();
553 exemptednicks.clear();
555 for (ConfigIter i = tags.first; i != tags.second; ++i)
557 ConfigTag* tag = i->second;
559 // If "target" is not found, try the old "channel" key to keep compatibility with 2.0 configs
560 const std::string target = tag->getString("target", tag->getString("channel"));
563 if (target[0] == '#')
564 exemptedchans.insert(target);
566 exemptednicks.insert(target);
570 ConfigTag* tag = ServerInstance->Config->ConfValue("filteropts");
571 std::string newrxengine = tag->getString("engine");
572 notifyuser = tag->getBool("notifyuser", true);
574 factory = RegexEngine ? (RegexEngine.operator->()) : NULL;
576 if (newrxengine.empty())
577 RegexEngine.SetProvider("regex");
579 RegexEngine.SetProvider("regex/" + newrxengine);
583 if (newrxengine.empty())
584 ServerInstance->SNO->WriteGlobalSno('f', "WARNING: No regex engine loaded - Filter functionality disabled until this is corrected.");
586 ServerInstance->SNO->WriteGlobalSno('f', "WARNING: Regex engine '%s' is not loaded - Filter functionality disabled until this is corrected.", newrxengine.c_str());
593 if ((!initing) && (RegexEngine.operator->() != factory))
595 ServerInstance->SNO->WriteGlobalSno('f', "Dumping all filters due to regex engine change");
603 Version ModuleFilter::GetVersion()
605 return Version("Text (spam) filtering", VF_VENDOR | VF_COMMON, RegexEngine ? RegexEngine->name : "");
608 std::string ModuleFilter::EncodeFilter(FilterResult* filter)
610 std::ostringstream stream;
611 std::string x = filter->freeform;
613 /* Hax to allow spaces in the freeform without changing the design of the irc protocol */
614 for (std::string::iterator n = x.begin(); n != x.end(); n++)
618 stream << x << " " << FilterActionToString(filter->action) << " " << filter->GetFlags() << " " << filter->duration << " :" << filter->reason;
622 FilterResult ModuleFilter::DecodeFilter(const std::string &data)
624 std::string filteraction;
626 irc::tokenstream tokens(data);
627 tokens.GetMiddle(res.freeform);
628 tokens.GetMiddle(filteraction);
629 if (!StringToFilterAction(filteraction, res.action))
630 throw ModuleException("Invalid action: " + filteraction);
632 std::string filterflags;
633 tokens.GetMiddle(filterflags);
634 char c = res.FillFlags(filterflags);
636 throw ModuleException("Invalid flag: '" + std::string(1, c) + "'");
638 std::string duration;
639 tokens.GetMiddle(duration);
640 res.duration = ConvToInt(duration);
642 tokens.GetTrailing(res.reason);
644 /* Hax to allow spaces in the freeform without changing the design of the irc protocol */
645 for (std::string::iterator n = res.freeform.begin(); n != res.freeform.end(); n++)
652 void ModuleFilter::OnSyncNetwork(ProtocolInterface::Server& server)
654 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); ++i)
656 FilterResult& filter = *i;
657 if (filter.from_config)
660 server.SendMetaData("filter", EncodeFilter(&filter));
664 void ModuleFilter::OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata)
666 if ((target == NULL) && (extname == "filter"))
670 FilterResult data = DecodeFilter(extdata);
671 this->AddFilter(data.freeform, data.action, data.reason, data.duration, data.GetFlags());
673 catch (ModuleException& e)
675 ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error when unserializing filter: " + e.GetReason());
680 FilterResult* ModuleFilter::FilterMatch(User* user, const std::string &text, int flgs)
682 static std::string stripped_text;
683 stripped_text.clear();
685 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); ++i)
687 FilterResult* filter = &*i;
689 /* Skip ones that dont apply to us */
690 if (!AppliesToMe(user, filter, flgs))
693 if ((filter->flag_strip_color) && (stripped_text.empty()))
695 stripped_text = text;
696 InspIRCd::StripColor(stripped_text);
699 if (filter->regex->Matches(filter->flag_strip_color ? stripped_text : text))
705 bool ModuleFilter::DeleteFilter(const std::string &freeform)
707 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
709 if (i->freeform == freeform)
719 std::pair<bool, std::string> ModuleFilter::AddFilter(const std::string &freeform, FilterAction type, const std::string &reason, long duration, const std::string &flgs)
721 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
723 if (i->freeform == freeform)
725 return std::make_pair(false, "Filter already exists");
731 filters.push_back(FilterResult(RegexEngine, freeform, reason, type, duration, flgs, false));
733 catch (ModuleException &e)
735 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error in regular expression '%s': %s", freeform.c_str(), e.GetReason().c_str());
736 return std::make_pair(false, e.GetReason());
738 return std::make_pair(true, "");
741 bool ModuleFilter::StringToFilterAction(const std::string& str, FilterAction& fa)
743 if (stdalgo::string::equalsci(str, "gline"))
745 else if (stdalgo::string::equalsci(str, "zline"))
747 else if (stdalgo::string::equalsci(str, "warn"))
749 else if (stdalgo::string::equalsci(str, "block"))
751 else if (stdalgo::string::equalsci(str, "silent"))
753 else if (stdalgo::string::equalsci(str, "kill"))
755 else if (stdalgo::string::equalsci(str, "shun") && (ServerInstance->XLines->GetFactory("SHUN")))
757 else if (stdalgo::string::equalsci(str, "none"))
765 std::string ModuleFilter::FilterActionToString(FilterAction fa)
769 case FA_GLINE: return "gline";
770 case FA_ZLINE: return "zline";
771 case FA_WARN: return "warn";
772 case FA_BLOCK: return "block";
773 case FA_SILENT: return "silent";
774 case FA_KILL: return "kill";
775 case FA_SHUN: return "shun";
776 default: return "none";
780 void ModuleFilter::ReadFilters()
782 for (std::vector<FilterResult>::iterator filter = filters.begin(); filter != filters.end(); )
784 if (filter->from_config)
786 ServerInstance->SNO->WriteGlobalSno('f', "FILTER: removing filter '" + filter->freeform + "' due to config rehash.");
787 delete filter->regex;
788 filter = filters.erase(filter);
792 // The filter is not from the config.
796 ConfigTagList tags = ServerInstance->Config->ConfTags("keyword");
797 for (ConfigIter i = tags.first; i != tags.second; ++i)
799 std::string pattern = i->second->getString("pattern");
800 std::string reason = i->second->getString("reason");
801 std::string action = i->second->getString("action");
802 std::string flgs = i->second->getString("flags");
803 unsigned long duration = i->second->getDuration("duration", 10*60, 1);
808 if (!StringToFilterAction(action, fa))
813 filters.push_back(FilterResult(RegexEngine, pattern, reason, fa, duration, flgs, true));
814 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Regular expression %s loaded.", pattern.c_str());
816 catch (ModuleException &e)
818 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error in regular expression '%s': %s", pattern.c_str(), e.GetReason().c_str());
823 ModResult ModuleFilter::OnStats(Stats::Context& stats)
825 if (stats.GetSymbol() == 's')
827 for (std::vector<FilterResult>::iterator i = filters.begin(); i != filters.end(); i++)
829 stats.AddRow(223, RegexEngine.GetProvider()+":"+i->freeform+" "+i->GetFlags()+" "+FilterActionToString(i->action)+" "+ConvToStr(i->duration)+" :"+i->reason);
831 for (ExemptTargetSet::const_iterator i = exemptedchans.begin(); i != exemptedchans.end(); ++i)
833 stats.AddRow(223, "EXEMPT "+(*i));
835 for (ExemptTargetSet::const_iterator i = exemptednicks.begin(); i != exemptednicks.end(); ++i)
837 stats.AddRow(223, "EXEMPT "+(*i));
840 return MOD_RES_PASSTHRU;
843 void ModuleFilter::OnUnloadModule(Module* mod)
845 // If the regex engine became unavailable or has changed, remove all filters
850 else if (RegexEngine.operator->() != factory)
852 factory = RegexEngine.operator->();
857 MODULE_INIT(ModuleFilter)