Redo slotAccountStatusChanged
Redo
if (accountInfo.profileInfo.type != profile::Type::SIP) {
// HACK TODO(sblin) change daemon or add signal to know when a Ring
// account is ready (when the keys are generated and the id present)
if (status == api::account::Status::REGISTERED && accountInfo.profileInfo.uri.empty()) {
// This part detect when a new Ring account is created.
accounts.erase(accountID);
addToAccounts(accountID);
emit linked.accountAdded(accountID);
} else if (!accountInfo.profileInfo.uri.empty()) {
accountInfo.status = status;
emit linked.accountStatusChanged(accountID);
}
} else {
accountInfo.status = status;
emit linked.accountStatusChanged(accountID);
}
This is dirty!
There is a lot to say, but two main points:
- The account creation detection must not happen here
- SIP signals are bugguy.