mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed: Responds sends now correct time difference
This commit is contained in:
parent
c9f618ddf6
commit
8c0b7ce776
@ -413,7 +413,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
|
|||||||
resp.mDataStream << makeKeyValue("pgp_name", pgp_name);
|
resp.mDataStream << makeKeyValue("pgp_name", pgp_name);
|
||||||
|
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
resp.mDataStream << makeKeyValue("last_usage", std::to_string(now - data.mLastUsageTS));
|
resp.mDataStream << makeKeyValue("last_usage", difftime(now, data.mLastUsageTS));
|
||||||
|
|
||||||
bool isAnonymous = false;
|
bool isAnonymous = false;
|
||||||
if(!data.mPgpKnown)
|
if(!data.mPgpKnown)
|
||||||
@ -468,7 +468,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
|
|||||||
|
|
||||||
for(std::map<RsIdentityUsage,time_t>::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it)
|
for(std::map<RsIdentityUsage,time_t>::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it)
|
||||||
{
|
{
|
||||||
usagesStream.getStreamToMember() << makeKeyValue("usage_time", std::to_string(now - it->second));
|
usagesStream.getStreamToMember() << makeKeyValue("usage_time", difftime(now, data.mLastUsageTS));
|
||||||
usagesStream.getStreamToMember() << makeKeyValue("usage_service", (int)(it->first.mServiceId));
|
usagesStream.getStreamToMember() << makeKeyValue("usage_service", (int)(it->first.mServiceId));
|
||||||
usagesStream.getStreamToMember() << makeKeyValue("usage_case", (int)(it->first.mUsageCode));
|
usagesStream.getStreamToMember() << makeKeyValue("usage_case", (int)(it->first.mUsageCode));
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <retroshare/rsiface.h>
|
#include <retroshare/rsiface.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include "Operators.h"
|
#include "Operators.h"
|
||||||
#include "ApiTypes.h"
|
#include "ApiTypes.h"
|
||||||
@ -745,11 +746,12 @@ void PeersHandler::handleGetNodeOptions(Request& req, Response& resp)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t now = time(NULL);
|
||||||
resp.mDataStream << makeKeyValue("peer_id", detail.id.toStdString());
|
resp.mDataStream << makeKeyValue("peer_id", detail.id.toStdString());
|
||||||
resp.mDataStream << makeKeyValue("name", detail.name);
|
resp.mDataStream << makeKeyValue("name", detail.name);
|
||||||
resp.mDataStream << makeKeyValue("location", detail.location);
|
resp.mDataStream << makeKeyValue("location", detail.location);
|
||||||
resp.mDataStream << makeKeyValue("pgp_id", detail.gpg_id.toStdString());
|
resp.mDataStream << makeKeyValue("pgp_id", detail.gpg_id.toStdString());
|
||||||
resp.mDataStream << makeKeyValue("last_contact", detail.lastConnect);
|
resp.mDataStream << makeKeyValue("last_contact", difftime(now, detail.lastConnect));
|
||||||
|
|
||||||
std::string status_message = mRsMsgs->getCustomStateString(detail.id);
|
std::string status_message = mRsMsgs->getCustomStateString(detail.id);
|
||||||
resp.mDataStream << makeKeyValueReference("status_message", status_message);
|
resp.mDataStream << makeKeyValueReference("status_message", status_message);
|
||||||
|
Loading…
Reference in New Issue
Block a user