aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-17 00:52:40 +0100
committerGravatar Sadie Powell2024-09-17 01:06:42 +0100
commite657edc2b36274b5684ac570a2bdcf4d063c91d4 (patch)
tree54f6dff12bb600f73018f03d918608700ab7782e /src
parentSort the 004 mode list alphabetically. (diff)
Fix rebuilding the 004 numeric on reloading core_info.
Diffstat (limited to 'src')
-rw-r--r--src/coremods/core_info/core_info.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/coremods/core_info/core_info.cpp b/src/coremods/core_info/core_info.cpp
index bb7b894fe..24906d0e7 100644
--- a/src/coremods/core_info/core_info.cpp
+++ b/src/coremods/core_info/core_info.cpp
@@ -63,6 +63,7 @@ struct ISupportAction final
class CoreModInfo final
: public Module
{
+private:
CommandAdmin cmdadmin;
CommandCommands cmdcommands;
CommandInfo cmdinfo;
@@ -92,11 +93,8 @@ class CoreModInfo final
return modestr;
}
- void OnServiceChange(const ServiceProvider& prov)
+ void Rebuild004()
{
- if (prov.service != SERVICE_MODE)
- return;
-
std::vector<std::string>& params = numeric004.GetParams();
params.erase(params.begin()+2, params.end());
@@ -108,6 +106,7 @@ class CoreModInfo final
numeric004.push(CreateModeList(MODETYPE_CHANNEL));
numeric004.push(CreateModeList(MODETYPE_CHANNEL, true));
}
+
public:
CoreModInfo()
: Module(VF_CORE | VF_VENDOR, "Provides the ADMIN, COMMANDS, INFO, MODULES, MOTD, TIME, SERVLIST, and VERSION commands")
@@ -166,6 +165,8 @@ public:
cmdadmin.admindesc = tag->getString("description");
cmdadmin.adminemail = tag->getString("email", "noreply@" + ServerInstance->Config->GetServerName(), 1);
+ Rebuild004();
+
cmdversion.BuildNumerics();
ServerInstance->AtomicActions.AddAction(new ISupportAction(isupport));
}
@@ -218,12 +219,14 @@ public:
void OnServiceAdd(ServiceProvider& service) override
{
- OnServiceChange(service);
+ if (service.service == SERVICE_MODE)
+ Rebuild004();
}
void OnServiceDel(ServiceProvider& service) override
{
- OnServiceChange(service);
+ if (service.service == SERVICE_MODE)
+ Rebuild004();
}
void Prioritize() override