X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_lusers.cpp;h=925a50643cb36fb0885f84cbc4d5fa1188c3e5d1;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=a0d0d0205ee26a310358e407978696da3cb8a690;hpb=c0aba5b728b0a921d95ec120aa638dab1520b42f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_lusers.cpp b/src/coremods/core_lusers.cpp index a0d0d0205..925a50643 100644 --- a/src/coremods/core_lusers.cpp +++ b/src/coremods/core_lusers.cpp @@ -1,8 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz + * Copyright (C) 2017-2019 Sadie Powell + * Copyright (C) 2012-2014, 2016 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006, 2010 Craig Edwards * * 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 @@ -61,12 +67,12 @@ class CommandLusers : public Command * @param user The user issuing the command * @return A value from CmdResult to indicate command success or failure. */ - CmdResult Handle(const std::vector& parameters, User *user); + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE; }; /** Handle /LUSERS */ -CmdResult CommandLusers::Handle (const std::vector&, User *user) +CmdResult CommandLusers::Handle(User* user, const Params& parameters) { unsigned int n_users = ServerInstance->Users->RegisteredUserCount(); ProtocolInterface::ServerList serverlist; @@ -110,11 +116,14 @@ public: { } - void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding) + void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding) CXX11_OVERRIDE { if (dest->registered != REG_ALL) return; + if (dest->server->IsULine()) + return; + if (adding) invisible++; else @@ -136,7 +145,7 @@ class ModuleLusers : public Module for (user_hash::const_iterator i = users.begin(); i != users.end(); ++i) { User* u = i->second; - if (u->IsModeSet(invisiblemode)) + if (!u->server->IsULine() && u->IsModeSet(invisiblemode)) c++; } return c; @@ -151,22 +160,22 @@ class ModuleLusers : public Module { } - void OnPostConnect(User* user) + void OnPostConnect(User* user) CXX11_OVERRIDE { counters.UpdateMaxUsers(); - if (user->IsModeSet(invisiblemode)) + if (!user->server->IsULine() && user->IsModeSet(invisiblemode)) counters.invisible++; } - void OnUserQuit(User* user, const std::string& message, const std::string& oper_message) + void OnUserQuit(User* user, const std::string& message, const std::string& oper_message) CXX11_OVERRIDE { - if (user->IsModeSet(invisiblemode)) + if (!user->server->IsULine() && user->IsModeSet(invisiblemode)) counters.invisible--; } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { - return Version("LUSERS", VF_VENDOR | VF_CORE); + return Version("Provides the LUSERS command", VF_VENDOR | VF_CORE); } };