diff options
| author | 2024-07-22 21:26:45 +0100 | |
|---|---|---|
| committer | 2024-07-22 21:26:45 +0100 | |
| commit | 304ad49279362eb9d3d28468e8e84a9ab0d9f119 (patch) | |
| tree | 0c2ef51b4e968f309a33b6c7975e00cb7954225a /src/modules.cpp | |
| parent | Adjust the build system for the new module structure. (diff) | |
| parent | Fix shadowing messages in pgsql and regex_pcre2. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'src/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index a69b65418..1ec07f9ba 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -46,8 +46,14 @@ void dynamic_reference_base::reset_all() } Module::Module(int mprops, const std::string& mdesc) + : Module(mprops, "", mdesc) +{ +} + +Module::Module(int mprops, const std::string& mversion, const std::string& mdesc) : description(mdesc) , properties(mprops) + , version(mversion) { } @@ -79,10 +85,19 @@ std::string Module::GetPropertyString() const size_t pos = 0; for (int mult = VF_CORE; mult <= VF_OPTCOMMON; mult *= 2, ++pos) if (!(this->properties & mult)) - propstr[pos] = tolower(propstr[pos]); + propstr[pos] = '-'; return propstr; } +std::string Module::GetVersion() const +{ + if (!version.empty()) + return version; + + const auto* dll_version = ModuleDLL->GetVersion(); + return dll_version ? dll_version : "unknown"; +} + void Module::DetachEvent(Implementation i) { ServerInstance->Modules.Detach(i, this); |
