libresapi fix compile error on windows due to time_t usage

This commit is contained in:
Gioacchino Mazzurco 2018-10-07 14:03:27 +02:00
parent ddf3164545
commit 72d8364370
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051
3 changed files with 7 additions and 6 deletions

View File

@ -132,8 +132,8 @@ public:
SendLobbyParticipantsTask(RsIdentity* idservice, ChatHandler::LobbyParticipantsInfo pi): SendLobbyParticipantsTask(RsIdentity* idservice, ChatHandler::LobbyParticipantsInfo pi):
GxsResponseTask(idservice, 0), mParticipantsInfo(pi) GxsResponseTask(idservice, 0), mParticipantsInfo(pi)
{ {
const std::map<RsGxsId, time_t>& map = mParticipantsInfo.participants; const auto& map = mParticipantsInfo.participants;
for(std::map<RsGxsId, time_t>::const_iterator mit = map.begin(); mit != map.end(); ++mit) for(auto mit = map.begin(); mit != map.end(); ++mit)
{ {
requestGxsId(mit->first); requestGxsId(mit->first);
} }
@ -144,8 +144,8 @@ protected:
virtual void gxsDoWork(Request &/*req*/, Response &resp) virtual void gxsDoWork(Request &/*req*/, Response &resp)
{ {
resp.mDataStream.getStreamToMember(); resp.mDataStream.getStreamToMember();
const std::map<RsGxsId, time_t>& map = mParticipantsInfo.participants; const auto& map = mParticipantsInfo.participants;
for(std::map<RsGxsId, time_t>::const_iterator mit = map.begin(); mit != map.end(); ++mit) for(auto mit = map.begin(); mit != map.end(); ++mit)
{ {
StreamBase& stream = resp.mDataStream.getStreamToMember(); StreamBase& stream = resp.mDataStream.getStreamToMember();
double last_active = mit->second; double last_active = mit->second;

View File

@ -26,6 +26,7 @@
#include "StateTokenServer.h" #include "StateTokenServer.h"
#include <retroshare/rsnotify.h> #include <retroshare/rsnotify.h>
#include <retroshare/rsmsgs.h> #include <retroshare/rsmsgs.h>
#include "util/rstime.h"
class RsPeers; class RsPeers;
class RsIdentity; class RsIdentity;
@ -117,7 +118,7 @@ public:
class LobbyParticipantsInfo{ class LobbyParticipantsInfo{
public: public:
StateToken state_token; StateToken state_token;
std::map<RsGxsId, time_t> participants; std::map<RsGxsId, rstime_t> participants;
}; };
class ChatInfo{ class ChatInfo{

View File

@ -521,7 +521,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages"); StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages");
usagesStream.getStreamToMember(); usagesStream.getStreamToMember();
for(std::map<RsIdentityUsage,time_t>::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it) for(auto it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it)
{ {
usagesStream.getStreamToMember() usagesStream.getStreamToMember()
<< makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS) << makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS)