Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-libclient
Commits
c143aa1d
Commit
c143aa1d
authored
Aug 29, 2019
by
Sébastien Blin
Browse files
accounts: add connectToAccountManager
Change-Id: Ife4f027a7ea4413de09dbde53543af22dc53a847
parent
eba15a14
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/api/newaccountmodel.h
View file @
c143aa1d
...
...
@@ -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
...
...
src/newaccountmodel.cpp
View file @
c143aa1d
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment