diff --git a/src/account.cpp b/src/account.cpp index 9fc1fbd3ff2b12db71146a90d9996118bda0977c..9a7fb5c097feab7cee9db1f8948440e63f1f794a 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -1091,6 +1091,12 @@ QString Account::displayName() const return d_ptr->accountDetail(DRing::Account::ConfProperties::DISPLAYNAME); } +bool Account::archiveHasPassword() const +{ + return d_ptr->accountDetail(DRing::Account::ConfProperties::ARCHIVE_HAS_PASSWORD) == "true"; +} + + QString Account::archivePassword() const { return d_ptr->accountDetail(DRing::Account::ConfProperties::ARCHIVE_PASSWORD); @@ -1106,6 +1112,11 @@ QString Account::archivePath() const return d_ptr->accountDetail(DRing::Account::ConfProperties::ARCHIVE_PATH); } +bool Account::changePassword(const QString& currentPassword, const QString newPassword) const +{ + return ConfigurationManager::instance().changeAccountPassword(id(), currentPassword, newPassword); +} + bool Account::allowIncomingFromUnknown() const { return d_ptr->accountDetail(DRing::Account::ConfProperties::DHT::PUBLIC_IN_CALLS) IS_TRUE; diff --git a/src/account.h b/src/account.h index 02223f1cb8e8a4631370c7ce8c74a8f61b8440d8..ca20cda386298d53582fce65be44328bc705709c 100644 --- a/src/account.h +++ b/src/account.h @@ -448,9 +448,11 @@ class LIB_EXPORT Account : public ItemBase { QString turnServerRealm () const; bool hasProxy () const; QString displayName () const; + bool archiveHasPassword () const; QString archivePassword () const; QString archivePin () const; QString archivePath () const; + bool changePassword (const QString& currentPassword, const QString newPassword) const; RegistrationState registrationState () const; Protocol protocol () const; ContactMethod* contactMethod () const; diff --git a/src/qtwrapper/configurationmanager_wrap.h b/src/qtwrapper/configurationmanager_wrap.h index 5ebbaefe4758348333f3defde6f456788f66cdde..4e1fd39eb8f31933050a7bf49006c7eb6fc35799 100644 --- a/src/qtwrapper/configurationmanager_wrap.h +++ b/src/qtwrapper/configurationmanager_wrap.h @@ -480,6 +480,11 @@ public Q_SLOTS: // METHODS return DRing::importAccounts(filePath.toStdString(), password.toStdString()); } + bool changeAccountPassword(const QString& id, const QString& currentPassword, const QString& newPassword) + { + return DRing::changeAccountPassword(id.toStdString(), currentPassword.toStdString(), newPassword.toStdString()); + } + void sendRegister(const QString& accountID, bool enable) { DRing::sendRegister(accountID.toStdString(), enable);