X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_xline%2Fcore_xline.cpp;h=13bc68a5f6319b4cbf4099906082a42bb645b153;hb=b4a174ee9c32d62ea6bf010e837e8c5b1c3d36a3;hp=e8f045c588bc091beead6382a671b6e544a1332c;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_xline/core_xline.cpp b/src/coremods/core_xline/core_xline.cpp index e8f045c58..13bc68a5f 100644 --- a/src/coremods/core_xline/core_xline.cpp +++ b/src/coremods/core_xline/core_xline.cpp @@ -1,7 +1,11 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2014 Attila Molnar + * Copyright (C) 2019 linuxdaemon + * Copyright (C) 2019 Robby + * Copyright (C) 2019 Matt Schatz + * Copyright (C) 2017-2021 Sadie Powell + * Copyright (C) 2014, 2016 Attila Molnar * * 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 @@ -73,6 +77,16 @@ class CoreModXLine : public Module user->CheckLines(true); } + void OnChangeRealHost(User* user, const std::string& newhost) CXX11_OVERRIDE + { + LocalUser* luser = IS_LOCAL(user); + if (!luser || luser->quitting) + return; + + luser->exempt = (ServerInstance->XLines->MatchesLine("E", user) != NULL); + luser->CheckLines(false); + } + 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) @@ -84,7 +98,7 @@ class CoreModXLine : public Module // 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('x', "Q-lined nickname %s from %s: %s", newnick.c_str(), user->GetFullRealHost().c_str(), xline->reason.c_str()); } @@ -93,6 +107,14 @@ class CoreModXLine : public Module 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);