Commit 7dc619d8 authored by Adrien Béraud's avatar Adrien Béraud

ringaccount: update registeredName if not found on the nameserver

Change-Id: I76a079c2222fcfac8cc5458e2ad33370983df167
parent 306aa133
......@@ -2119,13 +2119,19 @@ RingAccount::doRegister_()
#if HAVE_RINGNS
// Look for registered name on the blockchain
nameDir_.get().lookupAddress(ringAccountId_, [w](const std::string& result, const NameDirectory::Response& response) {
if (response == NameDirectory::Response::found)
if (auto this_ = w.lock()) {
if (auto this_ = w.lock()) {
if (response == NameDirectory::Response::found) {
if (this_->registeredName_ != result) {
this_->registeredName_ = result;
emitSignal<DRing::ConfigurationSignal::VolatileDetailsChanged>(this_->accountID_, this_->getVolatileAccountDetails());
}
} else if (response == NameDirectory::Response::notFound) {
if (not this_->registeredName_.empty()) {
this_->registeredName_.clear();
emitSignal<DRing::ConfigurationSignal::VolatileDetailsChanged>(this_->accountID_, this_->getVolatileAccountDetails());
}
}
}
});
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment