mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-05 12:51:08 -05:00
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:
parent
115a80045e
commit
c45582738e
@ -228,17 +228,18 @@ void p3disc::statusChange(const std::list<pqipeer> &plist)
|
|||||||
// sendPeerDetails(pit->id, pit->id);
|
// sendPeerDetails(pit->id, pit->id);
|
||||||
// /* send our details to them */
|
// /* send our details to them */
|
||||||
sendOwnVersion(pit->id);
|
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 */
|
/* get a peer lists */
|
||||||
|
|
||||||
#ifdef P3DISC_DEBUG
|
#ifdef P3DISC_DEBUG
|
||||||
std::cerr << "p3disc::respondToPeer() id: " << id;
|
std::cerr << "p3disc::sendAllInfoToJustConnectedPeer() id: " << id;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#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)) */
|
/* (dest (to), source (cert)) */
|
||||||
void p3disc::sendPeerDetails(std::string to, std::string about) {
|
void p3disc::sendPeerDetails(std::string to, std::string about) {
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,8 @@ void getversions(std::map<std::string, std::string> &versions);
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
void sendAllInfoToPeer(std::string id);
|
void sendAllInfoToJustConnectedPeer(std::string id);
|
||||||
|
void sendJustConnectedPeerInfoToAllPeer(std::string id);
|
||||||
|
|
||||||
/* Network Output */
|
/* Network Output */
|
||||||
//void sendOwnDetails(std::string to);
|
//void sendOwnDetails(std::string to);
|
||||||
|
Loading…
Reference in New Issue
Block a user