+
+ virtual void OnRehash(User *user)
+ {
+ ConfigTag* tag = ServerInstance->Config->ConfValue("rline");
+
+ MatchOnNickChange = tag->getBool("matchonnickchange");
+ ZlineOnMatch = tag->getBool("zlineonmatch");
+ std::string newrxengine = tag->getString("engine");
+
+ if (newrxengine.empty())
+ rxfactory.SetProvider("regex");
+ else
+ rxfactory.SetProvider("regex/" + newrxengine);
+ if (!rxfactory)
+ {
+ ServerInstance->SNO->WriteToSnoMask('a', "WARNING: Regex engine '%s' is not loaded - R-Line functionality disabled until this is corrected.", newrxengine.c_str());
+ }
+ }
+
+ virtual ModResult OnStats(char symbol, User* user, string_list &results)
+ {
+ if (symbol != 'R')
+ return MOD_RES_PASSTHRU;
+
+ ServerInstance->XLines->InvokeStats("R", 223, user, results);
+ return MOD_RES_DENY;
+ }
+
+ virtual void OnUserPostNick(User *user, const std::string &oldnick)
+ {
+ if (!IS_LOCAL(user))
+ return;
+
+ if (!MatchOnNickChange)
+ return;
+
+ XLine *rl = ServerInstance->XLines->MatchesLine("R", user);
+
+ if (rl)
+ {
+ // Bang! :D
+ rl->Apply(user);
+ }
+ }
+
+ virtual void OnBackgroundTimer(time_t curtime)
+ {
+ if (added_zline)
+ {
+ added_zline = false;
+ ServerInstance->XLines->ApplyLines();
+ }
+ }
+