summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/cs_xop.c25
-rw-r--r--src/servers.c6
2 files changed, 25 insertions, 6 deletions
diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c
index 0f5f863dc..2fe9daf30 100644
--- a/src/core/cs_xop.c
+++ b/src/core/cs_xop.c
@@ -541,17 +541,30 @@ class CSXOP : public Module
this->SetVersion("$Id$");
this->SetType(CORE);
- if (ModeManager::FindChannelModeByName(CMODE_OWNER))
- this->AddCommand(CHANSERV, new CommandCSQOP());
- if (ModeManager::FindChannelModeByName(CMODE_PROTECT))
- this->AddCommand(CHANSERV, new CommandCSAOP());
- if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
- this->AddCommand(CHANSERV, new CommandCSHOP());
this->AddCommand(CHANSERV, new CommandCSSOP());
+ this->AddCommand(CHANSERV, new CommandCSAOP());
this->AddCommand(CHANSERV, new CommandCSVOP());
+ if (serv_uplink && is_sync(serv_uplink))
+ OnUplinkSync();
+ else
+ {
+ /* We don't want to add some commands until we are synced, so we know what modes
+ * exist and what dont
+ */
+ ModuleManager::Attach(I_OnUplinkSync, this);
+ }
ModuleManager::Attach(I_OnChanServHelp, this);
}
+
+ void OnUplinkSync()
+ {
+ if (ModeManager::FindChannelModeByName(CMODE_OWNER))
+ this->AddCommand(CHANSERV, new CommandCSQOP());
+ if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
+ this->AddCommand(CHANSERV, new CommandCSHOP());
+ }
+
void OnChanServHelp(User *u)
{
if (ModeManager::FindChannelModeByName(CMODE_OWNER))
diff --git a/src/servers.c b/src/servers.c
index 959e2be2d..c16305c1d 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -566,6 +566,12 @@ void finish_sync(Server * serv, int sync_links)
// Perhaps this should be done if serv == serv_uplink?
restore_unsynced_topics();
Alog() << "Server " << serv->name << " is done syncing";
+
+ FOREACH_MOD(I_OnServerSync, OnServerSync(s));
+ if (serv == serv_uplink)
+ {
+ FOREACH_MOD(I_OnUplinkSync, OnUplinkSync());
+ }
}
/*******************************************************************/