diff --git a/include/transport/userregistry.h b/include/transport/userregistry.h index 5b92298586d0bbd86ebb994469d51030208a41ac..589a37e483823fe2e181dff2744e4a603ee8c484 100644 --- a/include/transport/userregistry.h +++ b/include/transport/userregistry.h @@ -86,7 +86,7 @@ class UserRegistry : public Swift::UserRegistry { /// Returns current password for particular user /// \param barejid JID. - const std::string &getUserPassword(const std::string &barejid); + const std::string getUserPassword(const std::string &barejid); /// Emitted when user wants to connect legacy network to validate the password. boost::signal onConnectUser; @@ -102,7 +102,6 @@ class UserRegistry : public Swift::UserRegistry { mutable std::map users; mutable Config *config; - std::string empty; }; } diff --git a/src/userregistry.cpp b/src/userregistry.cpp index c6287faf99854f712bb9b877550836bc9be67f14..684db5609ce943a9170295bf73bdc524fef3a0a2 100644 --- a/src/userregistry.cpp +++ b/src/userregistry.cpp @@ -116,10 +116,10 @@ void UserRegistry::onPasswordInvalid(const Swift::JID &user) { } } -const std::string &UserRegistry::getUserPassword(const std::string &barejid) { +const std::string UserRegistry::getUserPassword(const std::string &barejid) { if (users.find(barejid) != users.end()) return users[barejid].password; - return empty; + return ""; } }