summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-09-02 15:17:30 +0100
committerPeter Powell <petpow@saberuk.com>2019-09-02 15:17:30 +0100
commit5cf6f65044c27a69e70d795d75e826ce3f0b97a1 (patch)
tree40247603a5556705a8638f9124fc48f481d943e6
parent78f9c572119aef08c9115ad61caa41e82b41c98a (diff)
Document ConfigStatus and add a way to detect the initial load.
-rw-r--r--include/configreader.h14
-rw-r--r--src/modules.cpp2
2 files changed, 13 insertions, 3 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 511bedbee..a891f98f7 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -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)
{
}
};
diff --git a/src/modules.cpp b/src/modules.cpp
index 6f7ca2694..4087a1d62 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -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