Merge branch 'master' into jsonapi

This commit is contained in:
G10h4ck 2018-10-10 22:23:28 +02:00 committed by GitHub
commit 047ae7f723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
260 changed files with 1737 additions and 1178 deletions

View file

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

View file

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

View file

@ -521,7 +521,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp)
StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages");
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()
<< makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS)

View file

@ -486,7 +486,7 @@ void RsControlModule::handleCreateLocation(Request &req, Response &resp)
resp.setFail("hidden_port out of range. It must fit into uint16!");
return;
}
hidden_port = p;
hidden_port = static_cast<uint16_t>(p);
}
RsPgpId pgp_id;
@ -527,7 +527,7 @@ void RsControlModule::handleCreateLocation(Request &req, Response &resp)
RsInit::SetHiddenLocation(hidden_address, hidden_port, false);
}
std::string ssl_password = RSRandom::random_alphaNumericString(RsInit::getSslPwdLen()) ;
std::string ssl_password = RSRandom::random_alphaNumericString(static_cast<uint32_t>(RsInit::getSslPwdLen())) ;
/* GenerateSSLCertificate - selects the PGP Account */
//RsInit::SelectGPGAccount(PGPId);
@ -581,7 +581,7 @@ bool RsControlModule::askForDeferredSelfSignature(const void *data, const uint32
}
}
bool RsControlModule::requestShutdown()
void RsControlModule::requestShutdown()
{
RS_STACK_MUTEX(mExitFlagMtx);
mProcessShouldExit = true;

View file

@ -50,7 +50,7 @@ public:
// full_control: set to true if this module should handle rsinit and login
// set to false if rsinit is handled by the Qt gui
RsControlModule(int argc, char **argv, StateTokenServer* sts, ApiServer* apiserver, bool full_control);
~RsControlModule();
~RsControlModule() override;
// returns true if the process should terminate
bool processShouldExit();
@ -62,12 +62,12 @@ public:
virtual bool askForPassword(const std::string &title, const std::string& key_details, bool prev_is_bad , std::string& password,bool& canceled) override;
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason = "") override;
virtual bool requestShutdown();
virtual void requestShutdown();
protected:
// from RsThread
// wee need a thread to call into things which block like askForPassword()
virtual void run();
virtual void run() override;
private:
void handleRunState(Request& req, Response& resp);