prevent discovery and p3PeerMgr::loadList() from erasing service permission flags. Now the existing pgp-based values are kept.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8122 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-04-04 21:18:43 +00:00
parent a15b69f5e9
commit 059a0b3bf7
2 changed files with 7 additions and 3 deletions

View File

@ -1700,7 +1700,8 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
std::cerr << std::endl;
#endif
/* ************* */
addFriend(peer_id, peer_pgp_id, pitem->netMode, pitem->vs_disc, pitem->vs_dht, pitem->lastContact, RS_NODE_PERM_DEFAULT);
// permission flags is used as a mask for the existing perms, so we set it to 0xffff
addFriend(peer_id, peer_pgp_id, pitem->netMode, pitem->vs_disc, pitem->vs_dht, pitem->lastContact, RS_NODE_PERM_ALL);
setLocation(pitem->peerId, pitem->location);
}

View File

@ -913,7 +913,10 @@ void p3discovery2::processContactInfo(const SSLID &fromId, const RsDiscContactIt
#ifdef P3DISC_DEBUG
std::cerr << "--> Adding to friends list " << item->sslId << " - " << item->pgpId << std::endl;
#endif
mPeerMgr->addFriend(item->sslId, item->pgpId, item->netMode, RS_VS_DISC_OFF, RS_VS_DHT_FULL,(time_t)0,RS_NODE_PERM_DEFAULT);
// We pass RS_NODE_PERM_ALL because the PGP id is already a friend, so we should keep the existing
// permission flags. Therefore the mask needs to be 0xffff.
mPeerMgr->addFriend(item->sslId, item->pgpId, item->netMode, RS_VS_DISC_OFF, RS_VS_DHT_FULL,(time_t)0,RS_NODE_PERM_ALL);
updatePeerAddresses(item);
}
}