mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 06:06:10 -04:00
Added new statusbar widget about pending discovery informations.
You can enable it in the server settings. Recompile of GUI needed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3956 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3a9181bc85
commit
4b091a54d6
16 changed files with 1100 additions and 873 deletions
|
@ -45,6 +45,7 @@ virtual ~RsDisc() { return; }
|
|||
virtual bool getDiscFriends(std::string id, std::list<std::string>& friends) = 0;
|
||||
virtual bool getDiscGPGFriends(std::string id, std::list<std::string>& gpg_friends) = 0;
|
||||
virtual bool getDiscVersions(std::map<std::string, std::string> &versions) = 0;
|
||||
virtual bool getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ bool p3Discovery::getDiscGPGFriends(std::string id, std::list<std::string>& gpg_
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool p3Discovery::getDiscFriends(std::string id, std::list<std::string> &friends)
|
||||
{
|
||||
if (mDisc)
|
||||
|
@ -56,3 +57,12 @@ bool p3Discovery::getDiscVersions(std::map<std::string, std::string> &versions)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool p3Discovery::getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount)
|
||||
{
|
||||
if (mDisc)
|
||||
{
|
||||
mDisc->getWaitingDiscCount(sendCount, recvCount);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ virtual ~p3Discovery() { return; }
|
|||
virtual bool getDiscFriends(std::string id, std::list<std::string> &friends);
|
||||
virtual bool getDiscGPGFriends(std::string id, std::list<std::string> &gpg_friends);
|
||||
virtual bool getDiscVersions(std::map<std::string, std::string> &versions);
|
||||
virtual bool getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ void p3disc::sendAllInfoToJustConnectedPeer(const std::string &id)
|
|||
rsPeers->getFriendList(friendIds);
|
||||
|
||||
/* send them a list of all friend's details */
|
||||
for(friendIdsIt = friendIds.begin(); friendIdsIt != friendIds.end(); friendIdsIt++) {
|
||||
for(friendIdsIt = friendIds.begin(); friendIdsIt != friendIds.end(); friendIdsIt++) {
|
||||
/* get details */
|
||||
peerConnectState detail;
|
||||
if (!mConnMgr->getFriendNetStatus(*friendIdsIt, detail)) {
|
||||
|
@ -1017,6 +1017,29 @@ void p3disc::getversions(std::map<std::string, std::string> &versions)
|
|||
versions = this->versions;
|
||||
}
|
||||
|
||||
void p3disc::getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount)
|
||||
{
|
||||
if (sendCount == NULL && recvCount == NULL) {
|
||||
/* Nothing to do */
|
||||
return;
|
||||
}
|
||||
|
||||
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
if (sendCount) {
|
||||
*sendCount = 0;
|
||||
|
||||
std::map<std::string, std::list<std::string> >::iterator it;
|
||||
for (it = sendIdList.begin(); it != sendIdList.end(); it++) {
|
||||
*sendCount += it->second.size();
|
||||
}
|
||||
}
|
||||
|
||||
if (recvCount) {
|
||||
*recvCount = pendingDiscReplyInList.size();
|
||||
}
|
||||
}
|
||||
|
||||
int p3disc::idServers()
|
||||
{
|
||||
RsStackMutex stack(mDiscMtx); /********** STACK LOCKED MTX ******/
|
||||
|
|
|
@ -92,6 +92,7 @@ int tick();
|
|||
bool potentialGPGproxies(const std::string& id, std::list<std::string> &proxyGPGIds);
|
||||
bool potentialproxies(const std::string& id, std::list<std::string> &proxyIds);
|
||||
void getversions(std::map<std::string, std::string> &versions);
|
||||
void getWaitingDiscCount(unsigned int *sendCount, unsigned int *recvCount);
|
||||
|
||||
/************* from AuthGPService ****************/
|
||||
virtual AuthGPGOperation *getGPGOperation();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue