diff --git a/src/dring/account_const.h b/src/dring/account_const.h index eaf6a9bfac50c16bb374a1b2435da33106ccaefd..8fd37c0138130417b7d5745cf5cbe9a3e82f7f87 100644 --- a/src/dring/account_const.h +++ b/src/dring/account_const.h @@ -146,6 +146,7 @@ constexpr static const char DHT_PEER_DISCOVERY [] = "Account.peerDiscovery" constexpr static const char ACCOUNT_PEER_DISCOVERY [] = "Account.accountDiscovery"; constexpr static const char ACCOUNT_PUBLISH [] = "Account.accountPublish"; constexpr static const char MANAGER_URI [] = "Account.managerUri"; +constexpr static const char MANAGER_USERNAME [] = "Account.managerUsername"; namespace Audio { diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index b212a097f48f20bd2a905fdf1eb9d554df496bea..8e516d09d67d8310c5a39fe2b197fbbd691117b5 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -702,6 +702,7 @@ void JamiAccount::serialize(YAML::Emitter &out) const out << YAML::Key << Conf::RING_ACCOUNT_RECEIPT_SIG << YAML::Value << YAML::Binary(receiptSignature_.data(), receiptSignature_.size()); out << YAML::Key << DRing::Account::ConfProperties::RING_DEVICE_NAME << YAML::Value << ringDeviceName_; out << YAML::Key << DRing::Account::ConfProperties::MANAGER_URI << YAML::Value << managerUri_; + out << YAML::Key << DRing::Account::ConfProperties::MANAGER_USERNAME << YAML::Value << managerUsername_; // tls submap out << YAML::Key << Conf::TLS_KEY << YAML::Value << YAML::BeginMap; @@ -738,6 +739,7 @@ void JamiAccount::unserialize(const YAML::Node &node) parseValueOptional(node, DRing::Account::ConfProperties::RING_DEVICE_NAME, ringDeviceName_); parseValueOptional(node, DRing::Account::ConfProperties::MANAGER_URI, managerUri_); + parseValueOptional(node, DRing::Account::ConfProperties::MANAGER_USERNAME, managerUsername_); try { parsePath(node, DRing::Account::ConfProperties::ARCHIVE_PATH, archivePath_, idPath_); @@ -985,7 +987,7 @@ JamiAccount::loadAccount(const std::string& archive_password, const std::string& creds = std::move(acreds); } else { auto screds = std::make_unique<ServerAccountManager::ServerAccountCredentials>(); - screds->username = username_; + screds->username = managerUsername_; creds = std::move(screds); } creds->password = archive_password; @@ -1099,6 +1101,7 @@ JamiAccount::setAccountDetails(const std::map<std::string, std::string>& details dhtPortUsed_ = dhtPort_; parseString(details, DRing::Account::ConfProperties::MANAGER_URI, managerUri_); + parseString(details, DRing::Account::ConfProperties::MANAGER_USERNAME, managerUsername_); parseString(details, DRing::Account::ConfProperties::USERNAME, username_); std::string archive_password; @@ -1184,6 +1187,7 @@ JamiAccount::getAccountDetails() const a.emplace(DRing::Account::ConfProperties::PROXY_SERVER, proxyServer_); a.emplace(DRing::Account::ConfProperties::PROXY_PUSH_TOKEN, deviceKey_); a.emplace(DRing::Account::ConfProperties::MANAGER_URI, managerUri_); + a.emplace(DRing::Account::ConfProperties::MANAGER_USERNAME, managerUsername_); #if HAVE_RINGNS a.emplace(DRing::Account::ConfProperties::RingNS::URI, nameServer_); #endif diff --git a/src/jamidht/jamiaccount.h b/src/jamidht/jamiaccount.h index 802086a45501656021018837a13b999d9baeb66b..58f1254fafc0ae102b975660950c49e0594fbfa5 100644 --- a/src/jamidht/jamiaccount.h +++ b/src/jamidht/jamiaccount.h @@ -633,6 +633,7 @@ private: std::string receivedParameter_ {}; std::string managerUri_ {}; + std::string managerUsername_ {}; /** * Optional: "rport" parameter from VIA header