diff options
| author | 2015-12-07 10:11:09 +0100 | |
|---|---|---|
| committer | 2015-12-07 10:11:09 +0100 | |
| commit | 6bc4db5e922dd49a46684c9b4e417cac36a71942 (patch) | |
| tree | 985e110a44a6b504589c0fadbc69b8dd494e5b93 /src/users.cpp | |
| parent | m_spanningtree Try FindServerID() first if the prefix looks like a sid in Tre... (diff) | |
| download | inspircd++-6bc4db5e922dd49a46684c9b4e417cac36a71942.tar.gz inspircd++-6bc4db5e922dd49a46684c9b4e417cac36a71942.tar.bz2 inspircd++-6bc4db5e922dd49a46684c9b4e417cac36a71942.zip | |
Do not insert FakeUsers into UserManager::uuidlist
Inserting them causes FindUUID() and FindNick() to return server users which is not what modules want
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp index 93fd8d065..fd4afbcef 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -74,8 +74,12 @@ User::User(const std::string& uid, Server* srv, int type) ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New UUID for user: %s", uuid.c_str()); - if (!ServerInstance->Users->uuidlist.insert(std::make_pair(uuid, this)).second) - throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor"); + // Do not insert FakeUsers into the uuidlist so FindUUID() won't return them which is the desired behavior + if (type != USERTYPE_SERVER) + { + if (!ServerInstance->Users.uuidlist.insert(std::make_pair(uuid, this)).second) + throw CoreException("Duplicate UUID in User constructor: " + uuid); + } } LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* servaddr) @@ -312,8 +316,7 @@ CullResult FakeUser::cull() { // Fake users don't quit, they just get culled. quitting = true; - // Fake users are not inserted into UserManager::clientlist, they're only in the uuidlist - // and they are removed from there by the linking mod when the server splits + // Fake users are not inserted into UserManager::clientlist or uuidlist, so we don't need to modify those here return User::cull(); } |
