diff options
| author | 2020-02-09 16:01:52 +0000 | |
|---|---|---|
| committer | 2020-02-09 17:16:07 +0000 | |
| commit | 1cdffcaad7e62f84ca1ee85e8c4265d2701afd08 (patch) | |
| tree | 48a13b1c4d65ca2c76852680a7dcba4db2696c65 /src/usermanager.cpp | |
| parent | Use C++11 inline initialisation for class members. (diff) | |
Move FindUUID to the UserManager class.
Diffstat (limited to 'src/usermanager.cpp')
| -rw-r--r-- | src/usermanager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index cc1fdf66b..1004e5748 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -434,3 +434,15 @@ already_sent_t UserManager::NextAlreadySentId() } return already_sent_id; } + +User* UserManager::FindUUID(const std::string& uuid) +{ + if (uuid.empty()) + return nullptr; + + user_hash::iterator uiter = this->uuidlist.find(uuid); + if (uiter == this->uuidlist.end()) + return nullptr; + + return uiter->second; +} |
