diff --git a/libtransport/UserRegistration.cpp b/libtransport/UserRegistration.cpp index 2f1f29c50b310ad46753d960555725db60b6436d..4da637600c09218d3b77518ed99b92eca2ad0972 100644 --- a/libtransport/UserRegistration.cpp +++ b/libtransport/UserRegistration.cpp @@ -47,13 +47,15 @@ UserRegistration::UserRegistration(Component *component, UserManager *userManage UserRegistration::~UserRegistration(){ } -bool UserRegistration::registerUser(const UserInfo &row) { +bool UserRegistration::registerUser(const UserInfo &row, bool allowPasswordChange) { UserInfo dummy; bool registered = m_storageBackend->getUser(row.jid, dummy); - m_storageBackend->setUser(row); - doUserRegistration(row); - onUserRegistered(row); + if (registered && !allowPasswordChange) { + m_storageBackend->setUser(row); + doUserRegistration(row); + onUserRegistered(row); + } return !registered; }