Commit 2dffbc93 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

Merge remote-tracking branch 'origin/master' into video_mixing

parents 3fcd87ba 27a9461b
......@@ -2466,9 +2466,14 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
/** @todo Deal with both the accountMap_ and the Configuration */
std::stringstream accountID;
std::string accountList(preferences.getAccountOrder());
accountID << "Account:" << time(NULL);
std::string newAccountID(accountID.str());
while (accountList.find(newAccountID) != std::string::npos) {
newAccountID += "1";
}
// Get the type
std::string accountType;
......@@ -2501,16 +2506,14 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
newAccount->setAccountDetails(details);
// Add the newly created account in the account order list
std::string accountList(preferences.getAccountOrder());
newAccountID += "/";
// Add the newly created account in the account order list
if (not accountList.empty()) {
// Prepend the new account
accountList.insert(0, newAccountID);
accountList.insert(0, newAccountID + "/");
preferences.setAccountOrder(accountList);
} else {
accountList = newAccountID;
accountList = newAccountID + "/";
preferences.setAccountOrder(accountList);
}
......@@ -2522,7 +2525,7 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
client_.getConfigurationManager()->accountsChanged();
return accountID.str();
return newAccountID;
}
void ManagerImpl::removeAccount(const std::string& accountID)
......
Supports Markdown
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