diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-03-31 04:42:00 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-03-31 04:42:00 +0000 |
| commit | b1c34faf49a74d5fe9db4d2601f78eb2e6b93ee1 (patch) | |
| tree | 9306727092817b60dd5be6a0eba20fa29b652f04 /src | |
| parent | b55ac06019785b308ac1ead44414f8c6dee226fc (diff) | |
Fixed cs_xop to not add its commands until after it knows what modes as supported by the IRCd
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2849 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/cs_xop.c | 25 | ||||
| -rw-r--r-- | src/servers.c | 6 |
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()); + } } /*******************************************************************/ |
