mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 03:36:58 -04:00
Expose more login related JSON API
/rsLoginHelper/isLoggedIn to check if already logged in /rsAccounts/getCurrentAccountId to get the id of current selected account, beware that an account may be selected without actually logging in
This commit is contained in:
parent
a9b1a15b43
commit
a8ddec03fc
7 changed files with 105 additions and 55 deletions
|
@ -101,7 +101,9 @@ RsDht *rsDht = NULL ;
|
|||
|
||||
//std::map<std::string,std::vector<std::string> > RsInit::unsupported_keys ;
|
||||
|
||||
RsLoginHelper* rsLoginHelper;
|
||||
RsLoginHelper* rsLoginHelper = nullptr;
|
||||
|
||||
RsAccounts* rsAccounts = nullptr;
|
||||
|
||||
class RsInitConfig
|
||||
{
|
||||
|
@ -1931,6 +1933,7 @@ int RsServer::StartupRetroShare()
|
|||
std::cerr << "== RsInit:: Retroshare core started ==" << std::endl;
|
||||
std::cerr << "========================================================================" << std::endl;
|
||||
|
||||
coreReady = true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2006,6 +2009,11 @@ bool RsLoginHelper::createLocation(
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool RsLoginHelper::isLoggedIn()
|
||||
{
|
||||
return RsControl::instance()->isReady();
|
||||
}
|
||||
|
||||
void RsLoginHelper::closeSession()
|
||||
{
|
||||
RsControl::instance()->rsGlobalShutDown();
|
||||
|
@ -2020,3 +2028,8 @@ void RsLoginHelper::Location::serial_process(
|
|||
RS_SERIAL_PROCESS(mLocationName);
|
||||
RS_SERIAL_PROCESS(mPpgName);
|
||||
}
|
||||
|
||||
bool RsAccounts::getCurrentAccountId(RsPeerId& id)
|
||||
{
|
||||
return rsAccountsDetails->getCurrentAccountId(id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue