Count the friends (gpg id's) instead of the locations (ssl id's) in the statusbar.

Moved update of the friends from QTimer to signals.
Combined p3LinkMgr::getFriendCount and p3LinkMgr::getOnlineCount and moved to p3PeerMgr.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4986 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-02-25 01:48:56 +00:00
parent 4867c76bb1
commit 45ac04e2e7
11 changed files with 111 additions and 89 deletions

View file

@ -207,20 +207,16 @@ bool p3Peers::getFriendList(std::list<std::string> &ids)
// return true;
//}
bool p3Peers::getPeerCount (unsigned int *pnFriendCount, unsigned int *pnOnlineCount, bool /*ssl*/)
bool p3Peers::getPeerCount (unsigned int *friendCount, unsigned int *onlineCount, bool ssl)
{
#ifdef P3PEERS_DEBUG
std::cerr << "p3Peers::getPeerCount()" << std::endl;
std::cerr << "p3Peers::getPeerCount()" << std::endl;
#endif
// This is no longer accurate!
*pnFriendCount = mLinkMgr->getFriendCount();
*pnOnlineCount = mLinkMgr->getOnlineCount();
/* get from mConnectMgr */
//return mConnMgr->getPeerCount(pnFriendCount, pnOnlineCount, ssl);
if (friendCount) *friendCount = mPeerMgr->getFriendCount(ssl, false);
if (onlineCount) *onlineCount = mPeerMgr->getFriendCount(ssl, true);
return true;
}
bool p3Peers::isOnline(const std::string &id)

View file

@ -51,7 +51,7 @@ virtual std::string getOwnId();
virtual bool getOnlineList(std::list<std::string> &ids);
virtual bool getFriendList(std::list<std::string> &ids);
//virtual bool getOthersList(std::list<std::string> &ids);
virtual bool getPeerCount (unsigned int *pnFriendCount, unsigned int *pnOnlineCount, bool ssl);
virtual bool getPeerCount (unsigned int *friendCount, unsigned int *onlineCount, bool ssl);
virtual bool isOnline(const std::string &id);
virtual bool isFriend(const std::string &id);

View file

@ -185,9 +185,9 @@ uint32_t p3ServerConfig::getUserLevel()
case RSCONFIG_USER_LEVEL_NEW:
{
if (mLinkMgr->getFriendCount() > MIN_BASIC_FRIENDS)
if (mPeerMgr->getFriendCount(true, false) > MIN_BASIC_FRIENDS)
{
userLevel = RSCONFIG_USER_LEVEL_BASIC;
userLevel = RSCONFIG_USER_LEVEL_BASIC;
}
}
case RSCONFIG_USER_LEVEL_BASIC:
@ -195,12 +195,12 @@ uint32_t p3ServerConfig::getUserLevel()
/* check that we have some lastConnect > 0 */
if (mPeerMgr->haveOnceConnected())
{
userLevel = RSCONFIG_USER_LEVEL_CASUAL;
userLevel = RSCONFIG_USER_LEVEL_CASUAL;
}
}
case RSCONFIG_USER_LEVEL_CASUAL:
case RSCONFIG_USER_LEVEL_POWER:
case RSCONFIG_USER_LEVEL_POWER:
{
/* check that the firewall is open */
@ -214,7 +214,7 @@ uint32_t p3ServerConfig::getUserLevel()
(RSNET_NATHOLE_NATPMP == firewallMode) ||
(RSNET_NATHOLE_FORWARDED == firewallMode))))
{
userLevel = RSCONFIG_USER_LEVEL_POWER;
userLevel = RSCONFIG_USER_LEVEL_POWER;
}
}
break; /* for all */