Merge pull request #775 from csoler/v0.6-PRTest

V0.6 pr test
This commit is contained in:
csoler 2017-04-17 22:03:48 +02:00 committed by GitHub
commit 4faaaf7093
56 changed files with 151 additions and 136 deletions

View File

@ -58,7 +58,7 @@
/*************************************/ /*************************************/
UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, const std::string& filteredipfile, bdDhtFunctions *fns) UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, std::string bootstrapfile, const std::string& filteredipfile, bdDhtFunctions *fns)
:UdpSubReceiver(pub), dhtMtx(true), mFns(fns) :UdpSubReceiver(pub), dhtMtx(true)//, mFns(fns)
{ {
std::string usedVersion; std::string usedVersion;

View File

@ -119,7 +119,7 @@ void clearDataTransferred();
bdMutex dhtMtx; /* for all class data (below) */ bdMutex dhtMtx; /* for all class data (below) */
bdNodeManager *mBitDhtManager; bdNodeManager *mBitDhtManager;
bdDhtFunctions *mFns; //bdDhtFunctions *mFns;
uint32_t mReadBytes; uint32_t mReadBytes;

View File

@ -10,8 +10,8 @@
namespace resource_api namespace resource_api
{ {
FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles *files): FileSearchHandler::FileSearchHandler(StateTokenServer *sts, RsNotify *notify, RsTurtle *turtle, RsFiles */*files*/):
mStateTokenServer(sts), mNotify(notify), mTurtle(turtle), mFiles(files), mStateTokenServer(sts), mNotify(notify), mTurtle(turtle),// mFiles(files),
mMtx("FileSearchHandler") mMtx("FileSearchHandler")
{ {
mNotify->registerNotifyClient(this); mNotify->registerNotifyClient(this);

View File

@ -24,7 +24,7 @@ private:
StateTokenServer* mStateTokenServer; StateTokenServer* mStateTokenServer;
RsNotify* mNotify; RsNotify* mNotify;
RsTurtle* mTurtle; RsTurtle* mTurtle;
RsFiles* mFiles; //RsFiles* mFiles;
class Search{ class Search{
public: public:

View File

@ -200,7 +200,7 @@ static bool have_avatar(RsMsgs* msgs, const RsPeerId& id)
return size != 0; return size != 0;
} }
void PeersHandler::handleGetStateString(Request& req, Response& resp) void PeersHandler::handleGetStateString(Request& /*req*/, Response& resp)
{ {
{ {
RS_STACK_MUTEX(mMtx); RS_STACK_MUTEX(mMtx);
@ -234,7 +234,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp)
std::string state_string; std::string state_string;
req.mStream << makeKeyValueReference("state_string", state_string); req.mStream << makeKeyValueReference("state_string", state_string);
uint32_t status; uint32_t status = RS_STATUS_OFFLINE;
if(state_string == "online") if(state_string == "online")
status = RS_STATUS_ONLINE; status = RS_STATUS_ONLINE;
else if(state_string == "busy") else if(state_string == "busy")
@ -246,7 +246,7 @@ void PeersHandler::handleSetStateString(Request& req, Response& resp)
resp.setOk(); resp.setOk();
} }
void PeersHandler::handleGetCustomStateString(Request& req, Response& resp) void PeersHandler::handleGetCustomStateString(Request& /*req*/, Response& resp)
{ {
{ {
RS_STACK_MUTEX(mMtx); RS_STACK_MUTEX(mMtx);

View File

@ -34,8 +34,8 @@
#include "serialiser/rstlvkeys.h" #include "serialiser/rstlvkeys.h"
#include "serialiser/rsgxsitems.h" #include "serialiser/rsgxsitems.h"
class RsGroupMetaData; struct RsGroupMetaData;
class RsMsgMetaData; struct RsMsgMetaData;
static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0001 = 0x0000 ; // change this, and keep old values if the content changes static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0001 = 0x0000 ; // change this, and keep old values if the content changes
static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0002 = 0xaf01 ; // current API static const uint32_t RS_GXS_GRP_META_DATA_VERSION_ID_0002 = 0xaf01 ; // current API

View File

@ -1972,7 +1972,7 @@ void RsGxsNetService::updateServerSyncTS()
#endif #endif
// I keep the creation, but the data is not used yet. // I keep the creation, but the data is not used yet.
#warning disabled this, but do we need it? #warning csoler 2016-12-12: Disabled this, but do we need it?
// RsGxsServerMsgUpdate& msui(mServerMsgUpdateMap[grpId]) ; // RsGxsServerMsgUpdate& msui(mServerMsgUpdateMap[grpId]) ;
// (cyril) I'm removing this, because the msgUpdateTS is updated when new messages are received by calling locked_stampMsgServerUpdateTS(). // (cyril) I'm removing this, because the msgUpdateTS is updated when new messages are received by calling locked_stampMsgServerUpdateTS().
@ -3000,7 +3000,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
} }
// FIXTESTS global variable rsReputations not available in unittests! // FIXTESTS global variable rsReputations not available in unittests!
#warning Update the code below to correctly send/recv dependign on reputation #warning csoler 2016-12-23: Update the code below to correctly send/recv dependign on reputation
if(!grpSyncItem->authorId.isNull() && mReputations->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE) if(!grpSyncItem->authorId.isNull() && mReputations->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{ {
#ifdef NXS_NET_DEBUG_0 #ifdef NXS_NET_DEBUG_0

View File

@ -45,7 +45,7 @@ bool AuthorPending::getAuthorRep(GixsReputation& rep, const RsGxsId& authorId, c
rep.id = authorId ; rep.id = authorId ;
rep.reputation_level = mRep->overallReputationLevel(authorId); rep.reputation_level = mRep->overallReputationLevel(authorId);
#warning can it happen that reputations do not have the info yet? #warning csoler 2017-01-10: Can it happen that reputations do not have the info yet?
return true ; return true ;
#ifdef TO_BE_REMOVED #ifdef TO_BE_REMOVED
{ {

View File

@ -1193,7 +1193,7 @@ bool p3GxsTunnelService::locked_sendClearTunnelData(RsGxsTunnelDHPublicKeyItem *
if(gitem->data_bytes == NULL) if(gitem->data_bytes == NULL)
{ {
delete gitem ; delete gitem ;
return NULL ; return false ;
} }
// by convention, we use a IV of 0 for unencrypted data. // by convention, we use a IV of 0 for unencrypted data.
memset(gitem->data_bytes,0,8) ; memset(gitem->data_bytes,0,8) ;

View File

@ -51,9 +51,14 @@ RsPluginManager::RsPluginManager(const RsFileHash &hash)
_allow_all_plugins = false ; _allow_all_plugins = false ;
} }
bool RsPluginManager::loadConfiguration(RsFileHash &loadHash)
{
return p3Config::loadConfiguration(loadHash);
}
void RsPluginManager::loadConfiguration() void RsPluginManager::loadConfiguration()
{ {
RsFileHash dummyHash ; RsFileHash dummyHash;
p3Config::loadConfiguration(dummyHash); p3Config::loadConfiguration(dummyHash);
} }

View File

@ -74,6 +74,7 @@ class RsPluginManager: public RsPluginHandler, public p3Config
// -------------------- Own members -------------------------// // -------------------- Own members -------------------------//
// //
virtual void addConfigurations(p3ConfigMgr *cfgMgr) ; virtual void addConfigurations(p3ConfigMgr *cfgMgr) ;
virtual bool loadConfiguration(RsFileHash &loadHash) ;
virtual void loadConfiguration() ; virtual void loadConfiguration() ;
/*! /*!

View File

@ -92,7 +92,7 @@ dhtPeerEntry::dhtPeerEntry()
return; return;
} }
p3DhtMgr::p3DhtMgr(std::string id, pqiConnectCb *cb) p3DhtMgr::p3DhtMgr(RsPeerId id, pqiConnectCb *cb)
:pqiNetAssistConnect(id, cb), dhtMtx("p3DhtMgr"), mStunRequired(true) :pqiNetAssistConnect(id, cb), dhtMtx("p3DhtMgr"), mStunRequired(true)
{ {
/* setup own entry */ /* setup own entry */
@ -237,13 +237,13 @@ bool p3DhtMgr::setExternalInterface(
/* add / remove peers */ /* add / remove peers */
bool p3DhtMgr::findPeer(std::string id) bool p3DhtMgr::findPeer(const RsPeerId& id)
{ {
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
mDhtModifications = true; mDhtModifications = true;
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id); it = peers.find(id);
if (it != peers.end()) if (it != peers.end())
{ {
@ -281,14 +281,14 @@ bool p3DhtMgr::findPeer(std::string id)
return true; return true;
} }
bool p3DhtMgr::dropPeer(std::string id) bool p3DhtMgr::dropPeer(const RsPeerId& id)
{ {
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
mDhtModifications = true; mDhtModifications = true;
/* once we are connected ... don't worry about them anymore */ /* once we are connected ... don't worry about them anymore */
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id); it = peers.find(id);
if (it == peers.end()) if (it == peers.end())
{ {
@ -302,14 +302,14 @@ bool p3DhtMgr::dropPeer(std::string id)
} }
/* post DHT key saying we should connect */ /* post DHT key saying we should connect */
bool p3DhtMgr::notifyPeer(std::string id) bool p3DhtMgr::notifyPeer(const RsPeerId& id)
{ {
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
#ifdef DHT_DEBUG #ifdef DHT_DEBUG
std::cerr << "p3DhtMgr::notifyPeer() " << id << std::endl; std::cerr << "p3DhtMgr::notifyPeer() " << id.toStdString() << std::endl;
#endif #endif
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id); it = peers.find(id);
if (it == peers.end()) if (it == peers.end())
{ {
@ -333,7 +333,7 @@ bool p3DhtMgr::notifyPeer(std::string id)
#ifdef DHT_LOGS #ifdef DHT_LOGS
{ {
/* Log */ /* Log */
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " TO SOON - DROPPING"); rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " TO SOON - DROPPING");
} }
#endif #endif
@ -352,7 +352,7 @@ bool p3DhtMgr::notifyPeer(std::string id)
#ifdef DHT_LOGS #ifdef DHT_LOGS
{ {
/* Log */ /* Log */
rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id + " PEER NOT FOUND - Trigger Search"); rslog(RSL_WARNING, p3dhtzone, "p3DhtMgr::notifyPeer() Id: " + id.toStdString() + " PEER NOT FOUND - Trigger Search");
} }
#endif #endif
it->second.lastTS = 0; it->second.lastTS = 0;
@ -364,14 +364,14 @@ bool p3DhtMgr::notifyPeer(std::string id)
} }
/* extract current peer status */ /* extract current peer status */
bool p3DhtMgr::getPeerStatus(std::string id, bool p3DhtMgr::getPeerStatus(const RsPeerId &id,
struct sockaddr_in &laddr, struct sockaddr_in &laddr,
struct sockaddr_in &raddr, struct sockaddr_in &raddr,
uint32_t &type, uint32_t &state) uint32_t &type, uint32_t &state)
{ {
RsStackMutex stack(dhtMtx); /* LOCK MUTEX */ RsStackMutex stack(dhtMtx); /* LOCK MUTEX */
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
it = peers.find(id); it = peers.find(id);
/* ignore OFF peers */ /* ignore OFF peers */
@ -776,7 +776,7 @@ int p3DhtMgr::checkPeerDHTKeys()
dhtMtx.lock(); /* LOCK MUTEX */ dhtMtx.lock(); /* LOCK MUTEX */
/* iterate through and find min time and suitable candidate */ /* iterate through and find min time and suitable candidate */
std::map<std::string, dhtPeerEntry>::iterator it,pit; std::map<RsPeerId, dhtPeerEntry>::iterator it,pit;
time_t now = time(NULL); time_t now = time(NULL);
uint32_t period = 0; uint32_t period = 0;
uint32_t repeatPeriod = 6000; uint32_t repeatPeriod = 6000;
@ -802,7 +802,7 @@ int p3DhtMgr::checkPeerDHTKeys()
period = DHT_CHECK_PERIOD; period = DHT_CHECK_PERIOD;
} }
#ifdef DHT_DEBUG #ifdef DHT_DEBUG
std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id; std::cerr << "p3DhtMgr::checkPeerDHTKeys() Peer: " << it->second.id.toStdString();
std::cerr << " Period: " << period; std::cerr << " Period: " << period;
std::cerr << " Delta: " << delta; std::cerr << " Delta: " << delta;
std::cerr << std::endl; std::cerr << std::endl;
@ -865,7 +865,7 @@ int p3DhtMgr::checkNotifyDHT()
RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/ RsStackMutex stack(dhtMtx); /***** LOCK MUTEX *****/
/* iterate through and find min time and suitable candidate */ /* iterate through and find min time and suitable candidate */
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
time_t now = time(NULL); time_t now = time(NULL);
int repeatPeriod = DHT_DEFAULT_PERIOD; int repeatPeriod = DHT_DEFAULT_PERIOD;
@ -1015,7 +1015,7 @@ int p3DhtMgr::checkStunState()
if (mDhtState == DHT_STATE_CHECK_PEERS) if (mDhtState == DHT_STATE_CHECK_PEERS)
{ {
/* check that they have all be searched for */ /* check that they have all be searched for */
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
for(it = peers.begin(); it != peers.end(); it++) for(it = peers.begin(); it != peers.end(); it++)
{ {
if (it->second.state == DHT_PEER_INIT) if (it->second.state == DHT_PEER_INIT)
@ -1287,7 +1287,7 @@ int p3DhtMgr::status(std::ostream &out)
out << "OWN DETAILS END----------------------------------------" << std::endl; out << "OWN DETAILS END----------------------------------------" << std::endl;
/* now peers states */ /* now peers states */
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
out << "PEER DETAILS ------------------------------------------" << std::endl; out << "PEER DETAILS ------------------------------------------" << std::endl;
for(it = peers.begin(); it != peers.end(); it++) for(it = peers.begin(); it != peers.end(); it++)
{ {
@ -1622,15 +1622,13 @@ bool p3DhtMgr::dhtResultNotify(std::string idhash)
std::cerr << "p3DhtMgr::dhtResultNotify() from idhash: "; std::cerr << "p3DhtMgr::dhtResultNotify() from idhash: ";
std::cerr << RsUtil::BinToHex(idhash) << std::endl; std::cerr << RsUtil::BinToHex(idhash) << std::endl;
#endif #endif
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
time_t now = time(NULL); time_t now = time(NULL);
/* if notify - we must match on the second hash */ /* if notify - we must match on the second hash */
for(it = peers.begin(); (it != peers.end()) && ((it->second).hash2 != idhash); it++) ; for(it = peers.begin(); (it != peers.end()) && ((it->second).hash2 != idhash); it++) ;
/* update data */ /* update data */
std::string peerid;
/* ignore OFF peers */ /* ignore OFF peers */
if ((it != peers.end()) && (it->second.state != DHT_PEER_OFF)) if ((it != peers.end()) && (it->second.state != DHT_PEER_OFF))
{ {
@ -1677,7 +1675,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash,
std::cerr << "p3DhtMgr::dhtResultSearch() for idhash: "; std::cerr << "p3DhtMgr::dhtResultSearch() for idhash: ";
std::cerr << RsUtil::BinToHex(idhash) << std::endl; std::cerr << RsUtil::BinToHex(idhash) << std::endl;
#endif #endif
std::map<std::string, dhtPeerEntry>::iterator it; std::map<RsPeerId, dhtPeerEntry>::iterator it;
bool doCb = false; bool doCb = false;
bool doStun = false; bool doStun = false;
uint32_t stunFlags = 0; uint32_t stunFlags = 0;
@ -1780,7 +1778,7 @@ bool p3DhtMgr::dhtResultSearch(std::string idhash,
void printDhtPeerEntry(dhtPeerEntry *ent, std::ostream &out) void printDhtPeerEntry(dhtPeerEntry *ent, std::ostream &out)
{ {
out << "DhtEntry: ID: " << ent->id; out << "DhtEntry: ID: " << ent->id.toStdString();
out << " State: " << ent->state; out << " State: " << ent->state;
out << " lastTS: " << ent->lastTS; out << " lastTS: " << ent->lastTS;
out << " notifyPending: " << ent->notifyPending; out << " notifyPending: " << ent->notifyPending;

View File

@ -78,7 +78,7 @@ class dhtPeerEntry
public: public:
dhtPeerEntry(); dhtPeerEntry();
std::string id; RsPeerId id;
uint32_t state; uint32_t state;
time_t lastTS; time_t lastTS;
@ -97,7 +97,7 @@ class p3DhtMgr: public pqiNetAssistConnect, public RsThread
/* /*
*/ */
public: public:
p3DhtMgr(std::string id, pqiConnectCb *cb); p3DhtMgr(RsPeerId id, pqiConnectCb *cb);
/********** External DHT Interface ************************ /********** External DHT Interface ************************
* These Functions are the external interface * These Functions are the external interface
@ -121,14 +121,14 @@ virtual bool setExternalInterface(struct sockaddr_in laddr,
struct sockaddr_in raddr, uint32_t type); struct sockaddr_in raddr, uint32_t type);
/* add / remove peers */ /* add / remove peers */
virtual bool findPeer(std::string id); virtual bool findPeer(const RsPeerId& id);
virtual bool dropPeer(std::string id); virtual bool dropPeer(const RsPeerId& id);
/* post DHT key saying we should connect (callback when done) */ /* post DHT key saying we should connect (callback when done) */
virtual bool notifyPeer(std::string id); virtual bool notifyPeer(const RsPeerId& id);
/* extract current peer status */ /* extract current peer status */
virtual bool getPeerStatus(std::string id, virtual bool getPeerStatus(const RsPeerId& id,
struct sockaddr_in &laddr, struct sockaddr_in &raddr, struct sockaddr_in &laddr, struct sockaddr_in &raddr,
uint32_t &type, uint32_t &mode); uint32_t &type, uint32_t &mode);
@ -154,17 +154,17 @@ virtual bool dhtResultBootstrap(std::string idhash);
protected: protected:
/* can block briefly (called only from thread) */ /* can block briefly (called only from thread) */
virtual bool dhtPublish(std::string id, virtual bool dhtPublish(std::string idhash,
struct sockaddr_in &laddr, struct sockaddr_in &laddr,
struct sockaddr_in &raddr, struct sockaddr_in &raddr,
uint32_t type, std::string sign); uint32_t type, std::string sign);
virtual bool dhtNotify(std::string peerid, std::string ownId, virtual bool dhtNotify(std::string idhash, std::string ownIdHash,
std::string sign); std::string sign);
virtual bool dhtSearch(std::string id, uint32_t mode); virtual bool dhtSearch(std::string idhash, uint32_t mode);
virtual bool dhtBootstrap(std::string storehash, std::string ownIdHash, virtual bool dhtBootstrap(std::string idhash, std::string ownIdHash,
std::string sign); /* to publish bootstrap */ std::string sign); /* to publish bootstrap */
@ -232,7 +232,7 @@ std::string randomBootstrapId();
dhtPeerEntry ownEntry; dhtPeerEntry ownEntry;
time_t ownNotifyTS; time_t ownNotifyTS;
std::map<std::string, dhtPeerEntry> peers; std::map<RsPeerId, dhtPeerEntry> peers;
std::list<std::string> stunIds; std::list<std::string> stunIds;
bool mStunRequired; bool mStunRequired;

View File

@ -397,7 +397,7 @@ private:
std::map<RsPeerId,sockaddr_storage> mReportedOwnAddresses ; std::map<RsPeerId,sockaddr_storage> mReportedOwnAddresses ;
std::map<RsNodeGroupId,RsGroupInfo> groupList; std::map<RsNodeGroupId,RsGroupInfo> groupList;
uint32_t lastGroupId; //uint32_t lastGroupId;
std::list<RsItem *> saveCleanupList; /* TEMPORARY LIST WHEN SAVING */ std::list<RsItem *> saveCleanupList; /* TEMPORARY LIST WHEN SAVING */

View File

@ -61,13 +61,19 @@ void pqiConnectCbDummy::peerStatus(const RsPeerId& id, const pqiIpAddrSet &ad
std::cerr << out << std::endl; std::cerr << out << std::endl;
} }
void pqiConnectCbDummy::peerConnectRequest(const RsPeerId& id, void pqiConnectCbDummy::peerConnectRequest(const RsPeerId &id, const sockaddr_storage &raddr
const struct sockaddr_storage &raddr, uint32_t source) , const sockaddr_storage &proxyaddr, const sockaddr_storage &srcaddr
, uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth)
{ {
std::cerr << "pqiConnectCbDummy::peerConnectRequest()"; std::cerr << "pqiConnectCbDummy::peerConnectRequest()";
std::cerr << " id: " << id; std::cerr << " id: " << id;
std::cerr << " raddr: " << sockaddr_storage_tostring(raddr); std::cerr << " raddr: " << sockaddr_storage_tostring(raddr);
std::cerr << " proxyaddr: " << sockaddr_storage_tostring(proxyaddr);
std::cerr << " srcaddr: " << sockaddr_storage_tostring(srcaddr);
std::cerr << " source: " << source; std::cerr << " source: " << source;
std::cerr << " flags: " << flags;
std::cerr << " delay: " << delay;
std::cerr << " bandwidth: " << bandwidth;
std::cerr << std::endl; std::cerr << std::endl;
} }

View File

@ -179,8 +179,9 @@ virtual ~pqiConnectCbDummy();
virtual void peerStatus(const RsPeerId& id, const pqiIpAddrSet &addrs, virtual void peerStatus(const RsPeerId& id, const pqiIpAddrSet &addrs,
uint32_t type, uint32_t mode, uint32_t source); uint32_t type, uint32_t mode, uint32_t source);
virtual void peerConnectRequest(const RsPeerId& id, virtual void peerConnectRequest(const RsPeerId& id, const struct sockaddr_storage &raddr,
const struct sockaddr_storage &raddr, uint32_t source); const struct sockaddr_storage &proxyaddr, const struct sockaddr_storage &srcaddr,
uint32_t source, uint32_t flags, uint32_t delay, uint32_t bandwidth);
//virtual void stunStatus(std::string id, const struct sockaddr_storage &raddr, uint32_t type, uint32_t flags); //virtual void stunStatus(std::string id, const struct sockaddr_storage &raddr, uint32_t type, uint32_t flags);
}; };

View File

@ -40,7 +40,7 @@ static struct RsLog::logInfo pqipersonzoneInfo = {RsLog::Default, "pqiperson"};
pqiperson::pqiperson(const RsPeerId& id, pqipersongrp *pg) : pqiperson::pqiperson(const RsPeerId& id, pqipersongrp *pg) :
PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"), PQInterface(id), mNotifyMtx("pqiperson-notify"), mPersonMtx("pqiperson"),
active(false), activepqi(NULL), inConnectAttempt(false), waittimes(0), active(false), activepqi(NULL), inConnectAttempt(false),// waittimes(0),
pqipg(pg) {} // TODO: must check id! pqipg(pg) {} // TODO: must check id!
pqiperson::~pqiperson() pqiperson::~pqiperson()

View File

@ -29,6 +29,7 @@
#define MRK_PQI_PERSON_HEADER #define MRK_PQI_PERSON_HEADER
#include <string>
#include "pqi/pqi.h" #include "pqi/pqi.h"
#include "util/rsnet.h" #include "util/rsnet.h"
@ -66,7 +67,7 @@ public:
virtual int reset() { pqistreamer::reset(); return ni->reset(); } virtual int reset() { pqistreamer::reset(); return ni->reset(); }
virtual int disconnect() { return reset() ; } virtual int disconnect() { return reset() ; }
virtual bool connect_parameter(uint32_t type, uint32_t value) { return ni->connect_parameter(type, value);} virtual bool connect_parameter(uint32_t type, uint32_t value) { return ni->connect_parameter(type, value);}
virtual bool connect_parameter(uint32_t type, std::string value) { return ni->connect_parameter(type, value);} virtual bool connect_parameter(uint32_t type, const std::string &value) { return ni->connect_parameter(type, value);}
virtual bool connect_additional_address(uint32_t type, const struct sockaddr_storage &addr) { return ni->connect_additional_address(type, addr); } virtual bool connect_additional_address(uint32_t type, const struct sockaddr_storage &addr) { return ni->connect_additional_address(type, addr); }
virtual int getConnectAddress(struct sockaddr_storage &raddr){ return ni->getConnectAddress(raddr); } virtual int getConnectAddress(struct sockaddr_storage &raddr){ return ni->getConnectAddress(raddr); }
@ -171,7 +172,7 @@ private:
bool active; bool active;
pqiconnect *activepqi; pqiconnect *activepqi;
bool inConnectAttempt; bool inConnectAttempt;
int waittimes; //int waittimes;
time_t lastHeartbeatReceived; // use to track connection failure time_t lastHeartbeatReceived; // use to track connection failure
pqipersongrp *pqipg; /* parent for callback */ pqipersongrp *pqipg; /* parent for callback */
}; };

View File

@ -1009,7 +1009,7 @@ int pqissl::Basic_Connection_Complete()
return -1; return -1;
} }
else if ((err == ECONNREFUSED)) else if (err == ECONNREFUSED)
{ {
rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId().toStdString()); rslog(RSL_WARNING, pqisslzone, "pqissl::Basic_Connection_Complete() ECONNREFUSED: cert: " + PeerId().toStdString());

View File

@ -53,7 +53,7 @@ static const uint32_t PQI_SSLUDP_DEF_CONN_PERIOD = 300; /* 5 minutes? */
/********** PQI SSL UDP STUFF **************************************/ /********** PQI SSL UDP STUFF **************************************/
pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm) : pqissludp::pqissludp(PQInterface *parent, p3LinkMgr *lm) :
pqissl(NULL, parent, lm), tou_bio(NULL), listen_checktime(0), pqissl(NULL, parent, lm), tou_bio(NULL),// listen_checktime(0),
mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0), mConnectPeriod(PQI_SSLUDP_DEF_CONN_PERIOD), mConnectFlags(0),
mConnectBandwidth(0) mConnectBandwidth(0)
{ {

View File

@ -95,7 +95,7 @@ private:
BIO *tou_bio; // specific to ssludp. BIO *tou_bio; // specific to ssludp.
long listen_checktime; //long listen_checktime;
uint32_t mConnectPeriod; uint32_t mConnectPeriod;
uint32_t mConnectFlags; uint32_t mConnectFlags;

View File

@ -627,7 +627,7 @@ bool getX509id(X509 *x509, RsPeerId& xid)
* more randomness * more randomness
*/ */
#warning this is cryptographically horrible. We should do a hash of the public key here!!! #warning csoler 2017-02-19: This is cryptographically horrible. We should do a hash of the public key here!!!
xid = RsPeerId(&signdata[signlen - CERTSIGNLEN]) ; xid = RsPeerId(&signdata[signlen - CERTSIGNLEN]) ;

View File

@ -25,7 +25,7 @@ typedef std::pair<RsGxsGroupId, RsGxsMessageId> RsGxsGrpMsgIdPair;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMessageId> > MsgRelatedIdResult; typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsGxsMessageId> > MsgRelatedIdResult;
typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq; typedef std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > GxsMsgReq;
class RsMsgMetaData; struct RsMsgMetaData;
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult; typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > MsgMetaResult;

View File

@ -5,7 +5,7 @@
#include "retroshare/rsgxsifacetypes.h" #include "retroshare/rsgxsifacetypes.h"
#include "retroshare/rstokenservice.h" #include "retroshare/rstokenservice.h"
class RsMsgMetaData ; struct RsMsgMetaData ;
typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap; typedef std::map<RsGxsGroupId, std::vector<RsMsgMetaData> > GxsMsgMetaMap;
typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap; typedef std::map<RsGxsGrpMsgIdPair, std::vector<RsMsgMetaData> > GxsMsgRelatedMetaMap;

View File

@ -66,8 +66,8 @@
*/ */
RsBanList *rsBanList = NULL ; RsBanList *rsBanList = NULL ;
p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr *nm) p3BanList::p3BanList(p3ServiceControl *sc, p3NetMgr */*nm*/)
:p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc), mNetMgr(nm) :p3Service(), mBanMtx("p3BanList"), mServiceCtrl(sc)//, mNetMgr(nm)
{ {
addSerialType(new RsBanListSerialiser()); addSerialType(new RsBanListSerialiser());

View File

@ -148,7 +148,7 @@ private:
std::map<struct sockaddr_storage, BanListPeer> mWhiteListedRanges; std::map<struct sockaddr_storage, BanListPeer> mWhiteListedRanges;
p3ServiceControl *mServiceCtrl; p3ServiceControl *mServiceCtrl;
p3NetMgr *mNetMgr; //p3NetMgr *mNetMgr;
time_t mLastDhtInfoRequest ; time_t mLastDhtInfoRequest ;
bool mIPFilteringEnabled ; bool mIPFilteringEnabled ;

View File

@ -1035,7 +1035,7 @@ bool p3GxsReputation::setOwnOpinion(const RsGxsId& gxsid, const RsReputations::O
if (rit == mReputations.end()) if (rit == mReputations.end())
{ {
#warning we should set the owner node id here. #warning csoler 2017-01-05: We should set the owner node id here.
mReputations[gxsid] = Reputation(gxsid); mReputations[gxsid] = Reputation(gxsid);
rit = mReputations.find(gxsid); rit = mReputations.find(gxsid);
} }

View File

@ -174,7 +174,7 @@ private:
time_t mLastIdentityFlagsUpdate ; time_t mLastIdentityFlagsUpdate ;
bool mReputationsUpdated; bool mReputationsUpdated;
float mAutoBanIdentitiesLimit ; //float mAutoBanIdentitiesLimit ;
bool mAutoSetPositiveOptionToContacts; bool mAutoSetPositiveOptionToContacts;
p3LinkMgr *mLinkMgr; p3LinkMgr *mLinkMgr;

View File

@ -788,7 +788,7 @@ bool p3IdService::createIdentity(uint32_t& token, RsIdentityParameters &params)
if (params.isPgpLinked) if (params.isPgpLinked)
{ {
#warning Backward compatibility issue to fix here in v0.7.0 #warning csoler 2017-02-07: Backward compatibility issue to fix here in v0.7.0
// This is a hack, because a bad decision led to having RSGXSID_GROUPFLAG_REALID be equal to GXS_SERV::FLAG_PRIVACY_PRIVATE. // This is a hack, because a bad decision led to having RSGXSID_GROUPFLAG_REALID be equal to GXS_SERV::FLAG_PRIVACY_PRIVATE.
// In order to keep backward compatibility, we'll also add the new value // In order to keep backward compatibility, we'll also add the new value

View File

@ -93,9 +93,9 @@ again:
idx = (idx + 1) % 4; idx = (idx + 1) % 4;
} }
idx = idx; //idx = idx;
return buf; return buf ;
} }
/**************** /****************

View File

@ -2394,7 +2394,7 @@ static int parse_secret_key(ops_region_t *region,ops_parse_info_t *pinfo)
else if(C.secret_key.s2k_usage != OPS_S2KU_NONE) else if(C.secret_key.s2k_usage != OPS_S2KU_NONE)
{ {
// this is V3 style, looks just like a V4 simple hash // this is V3 style, looks just like a V4 simple hash
C.secret_key.algorithm=C.secret_key.s2k_usage; C.secret_key.algorithm=(ops_symmetric_algorithm_t)C.secret_key.s2k_usage;
C.secret_key.s2k_usage=OPS_S2KU_ENCRYPTED; C.secret_key.s2k_usage=OPS_S2KU_ENCRYPTED;
C.secret_key.s2k_specifier=OPS_S2KS_SIMPLE; C.secret_key.s2k_specifier=OPS_S2KS_SIMPLE;
C.secret_key.hash_algorithm=OPS_HASH_MD5; C.secret_key.hash_algorithm=OPS_HASH_MD5;

View File

@ -651,7 +651,7 @@ static time_t parseRFC822Date(const std::string &pubDate)
offset = abs(offset); offset = abs(offset);
offset = ((offset / 100)*60 + (offset % 100))*sgn; offset = ((offset / 100)*60 + (offset % 100))*sgn;
} else { } else {
for (int i=0; known_zones[i].tzName != 0; i++) { for (int i=0; known_zones[i].tzName[0] != 0; i++) {
if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) { if (0 == strncasecmp(dateString, known_zones[i].tzName, strlen(known_zones[i].tzName))) {
offset = known_zones[i].tzOffset; offset = known_zones[i].tzOffset;
break; break;

View File

@ -66,7 +66,9 @@ private:
AVPacket decoding_buffer; AVPacket decoding_buffer;
uint64_t encoding_frame_count ; uint64_t encoding_frame_count ;
#ifdef DEBUG_MPEG_VIDEO
FILE *encoding_debug_file ; FILE *encoding_debug_file ;
#endif
}; };
// This class decodes video from a stream. It keeps a queue of // This class decodes video from a stream. It keeps a queue of

View File

@ -1208,6 +1208,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint )
contextMnu.exec(QCursor::pos()); contextMnu.exec(QCursor::pos());
} }
#ifdef SUSPENDED
static void set_item_background(QTreeWidgetItem *item, uint32_t type) static void set_item_background(QTreeWidgetItem *item, uint32_t type)
{ {
QBrush brush; QBrush brush;
@ -1248,7 +1249,6 @@ static void update_children_background(QTreeWidgetItem *item, uint32_t type)
} }
} }
#ifdef SUSPENDED
static void set_tree_background(QTreeWidget *tree, uint32_t type) static void set_tree_background(QTreeWidget *tree, uint32_t type)
{ {
std::cerr << "CirclesDialog set_tree_background()"; std::cerr << "CirclesDialog set_tree_background()";
@ -1993,7 +1993,7 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const
return tr("Membership verification in circle %1.").arg(QString::fromStdString(u.mGrpId.toStdString())); return tr("Membership verification in circle %1.").arg(QString::fromStdString(u.mGrpId.toStdString()));
} }
#warning TODO! Add the different strings and translations here. #warning TODO! csoler 2017-01-03: Add the different strings and translations here.
default: default:
return QString("Undone yet"); return QString("Undone yet");
} }

View File

@ -287,7 +287,7 @@
<height>692</height> <height>692</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="scrollAreaWidgetContentsVLayout">
<item> <item>
<widget class="QFrame" name="headerFramePerson"> <widget class="QFrame" name="headerFramePerson">
<property name="frameShape"> <property name="frameShape">
@ -296,12 +296,12 @@
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="headerFramePersonGLayout">
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>12</number> <number>12</number>
</property> </property>
<item row="0" column="3"> <item row="0" column="3">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="headerFramePersonVLayout">
<item> <item>
<widget class="StyledElidedLabel" name="headerTextLabel_Person"> <widget class="StyledElidedLabel" name="headerTextLabel_Person">
<property name="text"> <property name="text">
@ -397,7 +397,7 @@
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::Box</enum>
</property> </property>
<layout class="QHBoxLayout" name="distantFrameHLayout"> <layout class="QHBoxLayout" name="inviteFrameHLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>6</number> <number>6</number>
</property> </property>
@ -514,7 +514,7 @@ border-image: url(:/images/closepressed.png)
<property name="title"> <property name="title">
<string>Identity info</string> <string>Identity info</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="detailsGroupBoxGLayout">
<item row="10" column="1"> <item row="10" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF"> <widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip"> <property name="toolTip">
@ -526,7 +526,7 @@ border-image: url(:/images/closepressed.png)
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_YourOpinion">
<property name="text"> <property name="text">
<string>Your opinion:</string> <string>Your opinion:</string>
</property> </property>
@ -540,7 +540,7 @@ border-image: url(:/images/closepressed.png)
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2"> <item row="7" column="0" colspan="2">
<widget class="Line" name="line"> <widget class="Line" name="line_IdInfo">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -728,7 +728,7 @@ p, li { white-space: pre-wrap; }
<widget class="QLineEdit" name="lineEdit_LastUsed"/> <widget class="QLineEdit" name="lineEdit_LastUsed"/>
</item> </item>
<item row="1" column="2" rowspan="11"> <item row="1" column="2" rowspan="11">
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="avatarGLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="avatarLabel"> <widget class="QLabel" name="avatarLabel">
<property name="sizePolicy"> <property name="sizePolicy">
@ -774,12 +774,12 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="avatarOpinionHLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_PosIcon">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>34</width> <width>34</width>
@ -813,14 +813,14 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="Line" name="line_3"> <widget class="Line" name="line_Opinion">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_NegIcon">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>34</width> <width>34</width>
@ -856,7 +856,7 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<spacer name="avatarVSpacer_2"> <spacer name="avatarVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -874,11 +874,11 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="usageStatisticsGBox">
<property name="title"> <property name="title">
<string>Usage statistics</string> <string>Usage statistics</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="usageStatisticsGBoxHLayout">
<item> <item>
<widget class="RSTextBrowser" name="usageStatistics_TB"/> <widget class="RSTextBrowser" name="usageStatistics_TB"/>
</item> </item>
@ -886,7 +886,7 @@ p, li { white-space: pre-wrap; }
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="scrollAreaWidgetContentsVSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -900,10 +900,8 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
<zorder>detailsGroupBox</zorder> <zorder>detailsGroupBox</zorder>
<zorder>detailsGroupBox</zorder> <zorder>usageStatisticsGBox</zorder>
<zorder>groupBox</zorder>
<zorder>headerFramePerson</zorder> <zorder>headerFramePerson</zorder>
<zorder>verticalSpacer_2</zorder>
</widget> </widget>
</widget> </widget>
</item> </item>

View File

@ -1207,7 +1207,7 @@ void MainWindow::showHelpDialog(const QString &topic)
void void
MainWindow::retranslateUi() MainWindow::retranslateUi()
{ {
retranslateUi(); //retranslateUi();
foreach (MainPage *page, ui->stackPages->pages()) { foreach (MainPage *page, ui->stackPages->pages()) {
page->retranslateUi(); page->retranslateUi();
} }

View File

@ -96,7 +96,7 @@ void CircleWidget::updateData(const RsGroupMetaData& gxs_group_info
} }
} }
QSize CircleWidget::sizeHint() QSize CircleWidget::sizeHint() const
{ {
QSize size; QSize size;
size.setHeight(ui->graphicsView->size().height() + ui->label->size().height()); size.setHeight(ui->graphicsView->size().height() + ui->label->size().height());

View File

@ -24,7 +24,7 @@ public:
, const RsGxsCircleDetails& details); , const RsGxsCircleDetails& details);
//Start QWidget Properties //Start QWidget Properties
QSize sizeHint(); QSize sizeHint() const;
//Start FlowLayoutItem Properties //Start FlowLayoutItem Properties
virtual const QPixmap getImage(); virtual const QPixmap getImage();
virtual const QPixmap getDragImage(); virtual const QPixmap getDragImage();

View File

@ -148,7 +148,7 @@ void IdentityWidget::updateData(const RsGxsIdGroup &gxs_group_info, const RsPeer
updateData(pgp_details); updateData(pgp_details);
} }
QSize IdentityWidget::sizeHint() QSize IdentityWidget::sizeHint() const
{ {
QSize size; QSize size;
size.setHeight(ui->graphicsView->size().height() + ui->labelName->size().height()); size.setHeight(ui->graphicsView->size().height() + ui->labelName->size().height());

View File

@ -26,7 +26,7 @@ public:
, const RsPeerDetails& pgp_details); , const RsPeerDetails& pgp_details);
//Start QWidget Properties //Start QWidget Properties
QSize sizeHint(); QSize sizeHint() const;
//Start FlowLayoutItem Properties //Start FlowLayoutItem Properties
virtual const QPixmap getImage(); virtual const QPixmap getImage();
virtual const QPixmap getDragImage(); virtual const QPixmap getDragImage();

View File

@ -901,7 +901,7 @@ void PeopleDialog::pf_dropEventOccursExt(QDropEvent *event)
QWidget *wid = QWidget *wid =
qobject_cast<QWidget *>(event->source());//QT5 return QObject qobject_cast<QWidget *>(event->source());//QT5 return QObject
FlowLayout *layout; FlowLayout *layout = NULL;
if (wid) layout = if (wid) layout =
qobject_cast<FlowLayout *>(wid->layout()); qobject_cast<FlowLayout *>(wid->layout());
if (layout) { if (layout) {
@ -991,7 +991,7 @@ void PeopleDialog::pf_dropEventOccursInt(QDropEvent *event)
QWidget *wid = QWidget *wid =
qobject_cast<QWidget *>(event->source());//QT5 return QObject qobject_cast<QWidget *>(event->source());//QT5 return QObject
FlowLayout *layout; FlowLayout *layout = NULL;
if (wid) layout = if (wid) layout =
qobject_cast<FlowLayout *>(wid->layout()); qobject_cast<FlowLayout *>(wid->layout());
if (layout) { if (layout) {

View File

@ -77,7 +77,7 @@ class RetroShareLink
RetroShareLink(const QUrl& url); RetroShareLink(const QUrl& url);
RetroShareLink(const QString& url); RetroShareLink(const QString& url);
#warning these methods should be static and return a created link #warning csoler 2017-01-04: These methods should be static and return a created link
bool createFile(const QString& name, uint64_t size, const QString& hash); bool createFile(const QString& name, uint64_t size, const QString& hash);
bool createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id); bool createExtraFile(const QString& name, uint64_t size, const QString& hash, const QString& ssl_id);
bool createPerson(const RsPgpId &id); bool createPerson(const RsPgpId &id);

View File

@ -63,7 +63,7 @@ void ChatDialog::closeEvent(QCloseEvent *event)
emit dialogClose(this); emit dialogClose(this);
} }
void ChatDialog::init(ChatId id, const QString &title) void ChatDialog::init(const ChatId &id, const QString &title)
{ {
mChatId = id; mChatId = id;
ChatWidget *cw = getChatWidget(); ChatWidget *cw = getChatWidget();
@ -102,14 +102,14 @@ void ChatDialog::init(ChatId id, const QString &title)
if (chatflags & RS_CHAT_OPEN) { if (chatflags & RS_CHAT_OPEN) {
if (id.isLobbyId()) { if (id.isLobbyId()) {
ChatLobbyDialog* cld = new ChatLobbyDialog(id.toLobbyId()); ChatLobbyDialog* cld = new ChatLobbyDialog(id.toLobbyId());
cld->init(); cld->init(ChatId(), "");
cd = cld; cd = cld;
} }
else if(id.isDistantChatId()) else if(id.isDistantChatId())
{ {
PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toDistantChatId()); PopupDistantChatDialog* pdcd = new PopupDistantChatDialog(id.toDistantChatId());
pdcd->init(id.toDistantChatId()); pdcd->init(id, "");
cd = pdcd; cd = pdcd;
} }
else else

View File

@ -84,7 +84,7 @@ protected:
virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers virtual QString getPeerName(const ChatId &sslid) const ; // can be overloaded for chat dialogs that have specific peers
virtual QString getOwnName() const; virtual QString getOwnName() const;
virtual void init(ChatId id, const QString &title); virtual void init(const ChatId &id, const QString &title);
virtual void addChatMsg(const ChatMessage& msg) = 0; virtual void addChatMsg(const ChatMessage& msg) = 0;
ChatId mChatId; ChatId mChatId;

View File

@ -304,7 +304,7 @@ void ChatLobbyDialog::showInPeopleTab()
idDialog->navigate(nickname); idDialog->navigate(nickname);
} }
void ChatLobbyDialog::init() void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/)
{ {
ChatLobbyInfo linfo ; ChatLobbyInfo linfo ;

View File

@ -71,7 +71,7 @@ protected:
virtual ~ChatLobbyDialog(); virtual ~ChatLobbyDialog();
void processSettings(bool load); void processSettings(bool load);
virtual void init(); virtual void init(const ChatId &id, const QString &title);
virtual bool canClose(); virtual bool canClose();
virtual void addChatMsg(const ChatMessage &msg); virtual void addChatMsg(const ChatMessage &msg);

View File

@ -76,7 +76,7 @@ ChatWidget::ChatWidget(QWidget *parent) :
int iconHeight = FMM*QFontMetricsF(font()).height() ; int iconHeight = FMM*QFontMetricsF(font()).height() ;
QSize iconSize = QSize(iconHeight,iconHeight); QSize iconSize = QSize(iconHeight,iconHeight);
QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM));
newMessages = false; newMessages = false;
typing = false; typing = false;
@ -258,7 +258,7 @@ void ChatWidget::addChatBarWidget(QWidget *w)
{ {
int iconHeight = FMM*QFontMetricsF(font()).height() ; int iconHeight = FMM*QFontMetricsF(font()).height() ;
QSize iconSize = QSize(iconHeight,iconHeight); QSize iconSize = QSize(iconHeight,iconHeight);
QSize buttonSize = QSize(iconSize + QSize(FMM,FMM)); QSize buttonSize = QSize(iconSize + QSize((int)FMM,(int)FMM));
w->setFixedSize(buttonSize); w->setFixedSize(buttonSize);
ui->pluginButtonFrame->layout()->addWidget(w) ; ui->pluginButtonFrame->layout()->addWidget(w) ;
} }

View File

@ -63,9 +63,12 @@ PopupDistantChatDialog::PopupDistantChatDialog(const DistantChatPeerId& tunnel_i
updateDisplay() ; updateDisplay() ;
} }
void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id) void PopupDistantChatDialog::init(const ChatId &chat_id, const QString &/*title*/)
{ {
_tunnel_id = peer_id; if (!chat_id.isDistantChatId())
return;
_tunnel_id = chat_id.toDistantChatId();
DistantChatPeerInfo tinfo; DistantChatPeerInfo tinfo;
if(!rsMsgs->getDistantChatStatus(_tunnel_id,tinfo)) if(!rsMsgs->getDistantChatStatus(_tunnel_id,tinfo))
@ -74,15 +77,15 @@ void PopupDistantChatDialog::init(const DistantChatPeerId &peer_id)
RsIdentityDetails iddetails ; RsIdentityDetails iddetails ;
if(rsIdentity->getIdDetails(tinfo.to_id,iddetails)) if(rsIdentity->getIdDetails(tinfo.to_id,iddetails))
PopupChatDialog::init(ChatId(peer_id), QString::fromUtf8(iddetails.mNickname.c_str())) ; PopupChatDialog::init(chat_id, QString::fromUtf8(iddetails.mNickname.c_str())) ;
else else
PopupChatDialog::init(ChatId(peer_id), QString::fromStdString(tinfo.to_id.toStdString())) ; PopupChatDialog::init(chat_id, QString::fromStdString(tinfo.to_id.toStdString())) ;
// Do not use setOwnId, because we don't want the user to change the GXS avatar from the chat window // Do not use setOwnId, because we don't want the user to change the GXS avatar from the chat window
// it will not be transmitted. // it will not be transmitted.
ui.ownAvatarWidget->setOwnId() ; // sets the flag ui.ownAvatarWidget->setOwnId() ; // sets the flag
ui.ownAvatarWidget->setId(ChatId(peer_id)) ; // sets the actual Id ui.ownAvatarWidget->setId(chat_id) ; // sets the actual Id
} }
void PopupDistantChatDialog::updateDisplay() void PopupDistantChatDialog::updateDisplay()

View File

@ -38,7 +38,7 @@ class PopupDistantChatDialog: public PopupChatDialog
/** Default destructor */ /** Default destructor */
virtual ~PopupDistantChatDialog(); virtual ~PopupDistantChatDialog();
virtual void init(const DistantChatPeerId& peer_id); virtual void init(const ChatId& chat_id, const QString &title);
virtual void closeEvent(QCloseEvent *e) ; virtual void closeEvent(QCloseEvent *e) ;
virtual QString getPeerName(const ChatId &id) const ; virtual QString getPeerName(const ChatId &id) const ;

View File

@ -46,7 +46,7 @@
#include <math.h> #include <math.h>
static const double Pi = 3.14159265358979323846264338327950288419717; //static const double Pi = 3.14159265358979323846264338327950288419717;
Edge::Edge(Node *sourceNode, Node *destNode) Edge::Edge(Node *sourceNode, Node *destNode)
: arrowSize(10) : arrowSize(10)

View File

@ -362,7 +362,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
bool itemsMoved = false; bool itemsMoved = false;
foreach (Node *node, _nodes) foreach (Node *node, _nodes)
if(node->advance()) if(node->progress())
itemsMoved = true; itemsMoved = true;
if (!itemsMoved) { if (!itemsMoved) {

View File

@ -215,7 +215,7 @@ void Node::calculateForces(const double *map,int width,int height,int W,int H,fl
newPos.setY(qMin(qMax(newPos.y(), sceneRect.top()) , sceneRect.bottom())); newPos.setY(qMin(qMax(newPos.y(), sceneRect.top()) , sceneRect.bottom()));
} }
bool Node::advance() bool Node::progress()
{ {
if(_type == GraphWidget::ELASTIC_NODE_TYPE_OWN) if(_type == GraphWidget::ELASTIC_NODE_TYPE_OWN)
return false; return false;

View File

@ -77,7 +77,7 @@ public:
std::string descString() const { return _desc_string ; } std::string descString() const { return _desc_string ; }
void calculateForces(const double *data,int width,int height,int W,int H,float x,float y,float speedf); void calculateForces(const double *data,int width,int height,int W,int H,float x,float y,float speedf);
bool advance(); bool progress();
QRectF boundingRect() const; QRectF boundingRect() const;
QPainterPath shape() const; QPainterPath shape() const;

View File

@ -1607,7 +1607,7 @@ void GxsForumThreadWidget::insertMessage()
int current_index = 0 ; int current_index = 0 ;
for(uint32_t i=0;i<(*it).size();++i) for(int i=0;i<(*it).size();++i)
{ {
ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( (*it)[i].first)); ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( (*it)[i].first));
ui->versions_CB->setItemData(i,QString::fromStdString((*it)[i].second.toStdString())); ui->versions_CB->setItemData(i,QString::fromStdString((*it)[i].second.toStdString()));

View File

@ -379,7 +379,7 @@ void GlobalRouterStatisticsWidget::updateContent()
painter.setPen(QColor::fromRgb(0,0,0)) ; painter.setPen(QColor::fromRgb(0,0,0)) ;
painter.setPen(QColor::fromRgb(0.5,0.5,0.5)); painter.setPen(QColor::fromRgb(127,127,127));
painter.drawRect(ox+2*cellx,current_oy+0.15*celly,fm_monospace.width(ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ; painter.drawRect(ox+2*cellx,current_oy+0.15*celly,fm_monospace.width(ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ;
float total_length = (matrix_info.friend_ids.size()+2)*cellx ; float total_length = (matrix_info.friend_ids.size()+2)*cellx ;