]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Document ConfigStatus and add a way to detect the initial load.
authorPeter Powell <petpow@saberuk.com>
Mon, 2 Sep 2019 14:17:30 +0000 (15:17 +0100)
committerPeter Powell <petpow@saberuk.com>
Mon, 2 Sep 2019 14:17:30 +0000 (15:17 +0100)
include/configreader.h
src/modules.cpp

index 511bedbee2618ecfb42977844d4455aed4096939..a891f98f7aeb86b36900f09fe0ada4032baea478 100644 (file)
@@ -490,13 +490,23 @@ class CoreExport ConfigReaderThread : public Thread
        bool IsDone() { return done; }
 };
 
+/** Represents the status of a config load. */
 class CoreExport ConfigStatus
 {
  public:
+       /** Whether this is the initial config load. */
+       bool const initial;
+
+       /** The user who initiated the config load or NULL if not initiated by a user. */
        User* const srcuser;
 
-       ConfigStatus(User* user = NULL)
-               : srcuser(user)
+       /** Initializes a new instance of the ConfigStatus class.
+        * @param user The user who initiated the config load or NULL if not initiated by a user.
+        * @param isinitial Whether this is the initial config load.
+        */
+       ConfigStatus(User* user = NULL, bool isinitial = false)
+               : initial(isinitial)
+               , srcuser(user)
        {
        }
 };
index 6f7ca2694b454239e6aa8078990807baf8c2bc30..4087a1d62ebc66a3853b235b8d1ec15ed22999bb 100644 (file)
@@ -507,7 +507,7 @@ void ModuleManager::LoadAll()
        }
 
        this->NewServices = NULL;
-       ConfigStatus confstatus;
+       ConfigStatus confstatus(NULL, true);
 
        // Step 3: Read the configuration for the modules. This must be done as part of
        // its own step so that services provided by modules can be registered before