diff options
author | Adam <Adam@anope.org> | 2011-03-11 17:09:49 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-03-11 17:09:49 -0500 |
commit | 46a3afadb9fbb78e96222cf7d4e494dbcbf66c44 (patch) | |
tree | 26a7eeba0690b203b641303398139c836d68a4db | |
parent | 1b2f3bf36964dd08c1bf6e803a36c03d6b7c492e (diff) |
Fixed validating users on all server syncs
-rw-r--r-- | modules/protocol/inspircd12.cpp | 20 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 20 | ||||
-rw-r--r-- | modules/protocol/plexus.cpp | 21 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 24 |
4 files changed, 51 insertions, 34 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp index 27f692956..42e897aa4 100644 --- a/modules/protocol/inspircd12.cpp +++ b/modules/protocol/inspircd12.cpp @@ -298,13 +298,6 @@ bool event_endburst(const Anope::string &source, const std::vector<Anope::string if (!s) throw CoreException("Got ENDBURST without a source"); - for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) - { - User *u = *it; - if (u->server == s && !u->IsIdentified()) - validate_user(u); - } - Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName(); s->Sync(true); @@ -760,7 +753,8 @@ class ProtoInspIRCd : public Module Capab.SetFlag(CAPAB_NOQUIT); - ModuleManager::Attach(I_OnUserNickChange, this); + Implementation i[] = { I_OnUserNickChange, I_OnServerSync }; + ModuleManager::Attach(i, this, 2); } void OnUserNickChange(User *u, const Anope::string &) @@ -770,6 +764,16 @@ class ProtoInspIRCd : public Module */ u->RemoveMode(NickServ, UMODE_REGISTERED); } + + void OnServerSync(Server *s) + { + for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) + { + User *u = *it; + if (u->server == s && !u->IsIdentified()) + validate_user(u); + } + } }; MODULE_INIT(ProtoInspIRCd) diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 3bab3ef99..5025884ea 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -308,13 +308,6 @@ bool event_endburst(const Anope::string &source, const std::vector<Anope::string if (!s) throw CoreException("Got ENDBURST without a source"); - for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) - { - User *u = *it; - if (u->server == s && !u->IsIdentified()) - validate_user(u); - } - Log(LOG_DEBUG) << "Processed ENDBURST for " << s->GetName(); s->Sync(true); @@ -754,13 +747,24 @@ class ProtoInspIRCd : public Module Capab.SetFlag(CAPAB_NOQUIT); - ModuleManager::Attach(I_OnUserNickChange, this); + Implementation i[] = { I_OnUserNickChange, I_OnServerSync }; + ModuleManager::Attach(i, this, 2); } void OnUserNickChange(User *u, const Anope::string &) { u->RemoveModeInternal(ModeManager::FindUserModeByName(UMODE_REGISTERED)); } + + void OnServerSync(Server *s) + { + for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) + { + User *u = *it; + if (u->server == s && !u->IsIdentified()) + validate_user(u); + } + } }; MODULE_INIT(ProtoInspIRCd) diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index d1062182f..a538479db 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -554,15 +554,7 @@ bool event_eob(const Anope::string &source, const std::vector<Anope::string> &pa { Server *s = Server::Find(source); if (s) - { s->Sync(true); - for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) - { - User *u = *it; - if (u->server == s && !u->IsIdentified()) - validate_user(u); - } - } return true; } @@ -644,6 +636,19 @@ class ProtoPlexus : public Module pmodule_ircd_message(&this->ircd_message); this->AddModes(); + + Implementation i[] = { I_OnServerSync }; + ModuleManager::Attach(i, this, 1); + } + + void OnServerSync(Server *s) + { + for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) + { + User *u = *it; + if (u->server == s && !u->IsIdentified()) + validate_user(u); + } } }; diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 8b6a73cd0..ea1c35c83 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -474,17 +474,8 @@ bool event_encap(const Anope::string &source, const std::vector<Anope::string> & bool event_pong(const Anope::string &source, const std::vector<Anope::string> ¶ms) { Server *s = Server::Find(source); - if (s && !s->IsSynced()) - { + if (s) s->Sync(false); - - for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) - { - User *u = *it; - if (u->server == s && !u->IsIdentified()) - validate_user(u); - } - } return true; } @@ -580,6 +571,19 @@ class ProtoRatbox : public Module pmodule_ircd_message(&this->ircd_message); this->AddModes(); + + Implementation i[] = { I_OnServerSync }; + ModuleManager::Attach(i, this, 1); + } + + void OnServerSync(Server *s) + { + for (patricia_tree<User *, ci::ci_char_traits>::iterator it(UserListByNick); it.next();) + { + User *u = *it; + if (u->server == s && !u->IsIdentified()) + validate_user(u); + } } }; |