]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_lusers.cpp
Add support for blocking tag messages with the deaf mode.
[user/henk/code/inspircd.git] / src / coremods / core_lusers.cpp
index 39a5dac7f61e421686752c6acb25002991bc96cc..925a50643cb36fb0885f84cbc4d5fa1188c3e5d1 100644 (file)
@@ -1,8 +1,14 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
+ *   Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2012-2014, 2016 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006, 2010 Craig Edwards <brain@inspircd.org>
  *
  * 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
@@ -115,6 +121,9 @@ public:
                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;
@@ -154,19 +163,19 @@ class ModuleLusers : public Module
        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) CXX11_OVERRIDE
        {
-               if (user->IsModeSet(invisiblemode))
+               if (!user->server->IsULine() && user->IsModeSet(invisiblemode))
                        counters.invisible--;
        }
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("LUSERS", VF_VENDOR | VF_CORE);
+               return Version("Provides the LUSERS command", VF_VENDOR | VF_CORE);
        }
 };