diff --git a/src/ringdht/ringaccount.cpp b/src/ringdht/ringaccount.cpp index 03a3f6c73191f3c072e6c0364ad4b235faf94be0..21c6b0fb1c3ae74b3d03095a29a50a888851f400 100644 --- a/src/ringdht/ringaccount.cpp +++ b/src/ringdht/ringaccount.cpp @@ -716,6 +716,8 @@ void RingAccount::serialize(YAML::Emitter &out) out << YAML::Key << Conf::RING_ACCOUNT_RECEIPT << YAML::Value << receipt_; 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_; + if (not registeredName_.empty()) + out << YAML::Key << DRing::Account::VolatileProperties::REGISTERED_NAME << YAML::Value << registeredName_; // tls submap out << YAML::Key << Conf::TLS_KEY << YAML::Value << YAML::BeginMap; @@ -747,6 +749,13 @@ void RingAccount::unserialize(const YAML::Node &node) } catch (const std::exception& e) { RING_WARN("can't read device name: %s", e.what()); } + if (registeredName_.empty()) { + try { + parseValue(node, DRing::Account::VolatileProperties::REGISTERED_NAME, registeredName_); + } catch (const std::exception& e) { + RING_WARN("can't read device name: %s", e.what()); + } + } try { parsePath(node, DRing::Account::ConfProperties::ARCHIVE_PATH, archivePath_, idPath_);