summaryrefslogtreecommitdiff
path: root/modules/protocol/plexus.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-02 13:59:33 -0500
committerAdam <Adam@anope.org>2013-01-02 13:59:33 -0500
commit827469600e8cf98fea7aec09ceaa77a097300b72 (patch)
tree6c957be4e9f2a0c8c6eddf2537b8553f1f6ffdbb /modules/protocol/plexus.cpp
parentbf718e869892bf418051d0140d7628c69d4ee3c9 (diff)
Move nickserv validate stuff to an event in nickserv.cpp
Diffstat (limited to 'modules/protocol/plexus.cpp')
-rw-r--r--modules/protocol/plexus.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp
index 24ee42746..5cb248bab 100644
--- a/modules/protocol/plexus.cpp
+++ b/modules/protocol/plexus.cpp
@@ -261,15 +261,27 @@ struct IRCDMessageUID : IRCDMessage
if (ip == "0")
ip.clear();
- User *user = new User(params[0], params[4], params[9], params[5], ip, source.GetServer(), params[10], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0, params[3], params[7]);
- if (params[8] != "0" && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp)
+ time_t ts;
+ try
{
- NickAlias *na = NickAlias::Find(user->nick);
- if (na)
- user->Login(na->nc);
+ ts = convertTo<time_t>(params[2]);
}
- else if (user && user->server->IsSynced() && NickServService)
- NickServService->Validate(user);
+ catch (const ConvertException &)
+ {
+ ts = Anope::CurTime;
+ }
+
+ User *user = new User(params[0], params[4], params[9], params[5], ip, source.GetServer(), params[10], ts, params[3], params[7]);
+ try
+ {
+ if (NickServService && params[8].is_pos_number_only() && convertTo<time_t>(params[8]) == user->timestamp)
+ {
+ NickAlias *na = NickAlias::Find(user->nick);
+ if (na)
+ NickServService->Login(user, na);
+ }
+ }
+ catch (const ConvertException &) { }
}
};
@@ -363,26 +375,12 @@ class ProtoPlexus : public Module
throw ModuleException("No protocol interface for hybrid");
this->AddModes();
-
- Implementation i[] = { I_OnServerSync };
- ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
}
~ProtoPlexus()
{
ModuleManager::UnloadModule(m_hybrid, NULL);
}
-
- void OnServerSync(Server *s) anope_override
- {
- if (NickServService)
- for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
- {
- User *u = it->second;
- if (u->server == s && !u->IsIdentified())
- NickServService->Validate(u);
- }
- }
};
MODULE_INIT(ProtoPlexus)