/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com>
+ * Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
+ * Copyright (C) 2018-2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
float percent = ((float)matches / (float)ServerInstance->Users->GetUsers().size()) * 100;
if (percent > itrigger)
{
- ServerInstance->SNO->WriteToSnoMask('a', "\2WARNING\2: %s tried to set a %s-line mask of %s, which covers %.2f%% of the network!", user->nick.c_str(), bantype, mask.c_str(), percent);
+ ServerInstance->SNO->WriteToSnoMask('a', "\002WARNING\002: %s tried to set a %s-line mask of %s, which covers %.2f%% of the network!", user->nick.c_str(), bantype, mask.c_str(), percent);
return true;
}
return false;
{
}
+ void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
+ {
+ if (user->quitting)
+ return;
+
+ user->exempt = (ServerInstance->XLines->MatchesLine("E", user) != NULL);
+ user->CheckLines(true);
+ }
+
ModResult OnUserPreNick(LocalUser* user, const std::string& newnick) CXX11_OVERRIDE
{
- // Check Q-Lines (for local nick changes only, remote servers have our Q-Lines to enforce themselves)
+ // Check Q-lines (for local nick changes only, remote servers have our Q-lines to enforce themselves)
XLine* xline = ServerInstance->XLines->MatchesLine("Q", newnick);
if (!xline)
return MOD_RES_PASSTHRU; // No match
- // A Q-Line matched the new nick, tell opers if the user is registered
+ // A Q-line matched the new nick, tell opers if the user is registered
if (user->registered == REG_ALL)
{
- ServerInstance->SNO->WriteGlobalSno('a', "Q-Lined nickname %s from %s: %s",
+ ServerInstance->SNO->WriteGlobalSno('a', "Q-lined nickname %s from %s: %s",
newnick.c_str(), user->GetFullRealHost().c_str(), xline->reason.c_str());
}
return MOD_RES_DENY;
}
+ void OnGarbageCollect() CXX11_OVERRIDE
+ {
+ // HACK: ELines are not expired properly at the moment but it can't be fixed
+ // as the XLine system is a spaghetti nightmare. Instead we skip over expired
+ // ELines in XLineManager::CheckELines() and expire them here instead.
+ ServerInstance->XLines->GetAll("E");
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides the ELINE, GLINE, KLINE, QLINE, and ZLINE commands", VF_VENDOR|VF_CORE);