send just connected peer info to all others

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2027 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-13 21:34:28 +00:00
parent 115a80045e
commit c45582738e
2 changed files with 25 additions and 4 deletions

View File

@ -228,17 +228,18 @@ void p3disc::statusChange(const std::list<pqipeer> &plist)
// sendPeerDetails(pit->id, pit->id);
// /* send our details to them */
sendOwnVersion(pit->id);
sendAllInfoToPeer(pit->id);
sendAllInfoToJustConnectedPeer(pit->id);
sendJustConnectedPeerInfoToAllPeer(pit->id);
}
}
}
void p3disc::sendAllInfoToPeer(std::string id)
void p3disc::sendAllInfoToJustConnectedPeer(std::string id)
{
/* get a peer lists */
#ifdef P3DISC_DEBUG
std::cerr << "p3disc::respondToPeer() id: " << id;
std::cerr << "p3disc::sendAllInfoToJustConnectedPeer() id: " << id;
std::cerr << std::endl;
#endif
@ -272,6 +273,25 @@ void p3disc::sendAllInfoToPeer(std::string id)
}
}
void p3disc::sendJustConnectedPeerInfoToAllPeer(std::string connectedPeerId)
{
/* get a peer lists */
#ifdef P3DISC_DEBUG
std::cerr << "p3disc::sendJustConnectedPeerInfoToAllPeer() connectedPeerId : " << connectedPeerId << std::endl;
#endif
std::string gpg_connectedPeerId = rsPeers->getGPGId(connectedPeerId);
std::list<std::string> onlineIds;
std::list<std::string>::iterator onlineIdsIt;
rsPeers->getOnlineList(onlineIds);
/* send them a list of all friend's details */
for(onlineIdsIt = onlineIds.begin(); onlineIdsIt != onlineIds.end(); onlineIdsIt++) {
sendPeerDetails(*onlineIdsIt, gpg_connectedPeerId);
}
}
/* (dest (to), source (cert)) */
void p3disc::sendPeerDetails(std::string to, std::string about) {
{

View File

@ -94,7 +94,8 @@ void getversions(std::map<std::string, std::string> &versions);
private:
void sendAllInfoToPeer(std::string id);
void sendAllInfoToJustConnectedPeer(std::string id);
void sendJustConnectedPeerInfoToAllPeer(std::string id);
/* Network Output */
//void sendOwnDetails(std::string to);