Skip to content
Snippets Groups Projects
Commit c143aa1d authored by Sébastien Blin's avatar Sébastien Blin
Browse files

accounts: add connectToAccountManager

Change-Id: Ife4f027a7ea4413de09dbde53543af22dc53a847
parent eba15a14
Branches
No related tags found
No related merge requests found
......@@ -150,6 +150,17 @@ public:
*/
bool registerName(const std::string& accountId, const std::string& password, const std::string& username);
/**
* Connect to JAMS to retrieve the account
* @param username
* @param password
* @param serverUri
* @return the account id
*/
static std::string connectToAccountManager(const std::string& username,
const std::string& password,
const std::string& serverUri);
/**
* Create a new Ring or SIP account
* @param type determine if the new account will be a Ring account or a SIP one
......
......@@ -858,6 +858,25 @@ NewAccountModel::createNewAccount(profile::Type type,
if (type == profile::Type::SIP) {
details[ConfProperties::USERNAME] = uri.c_str();
}
QString accountId = ConfigurationManager::instance().addAccount(details);
return accountId.toStdString();
}
std::string
NewAccountModel::connectToAccountManager(const std::string& username,
const std::string& password,
const std::string& serverUri)
{
MapStringString details = ConfigurationManager::instance().getAccountTemplate("RING");
using namespace DRing::Account;
details[ConfProperties::TYPE] = "RING";
details[ConfProperties::USERNAME] = username.c_str();
details[ConfProperties::ARCHIVE_PASSWORD] = password.c_str();
details[ConfProperties::MANAGER_URI] = serverUri.c_str();
QString accountId = ConfigurationManager::instance().addAccount(details);
return accountId.toStdString();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment