added missing own id from group list, and removed possible duplicates in random group ids

This commit is contained in:
csoler 2016-07-06 22:16:05 -04:00
parent 269f9457be
commit a69629cf73
2 changed files with 7 additions and 2 deletions

View File

@ -2304,7 +2304,8 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
ginfo.flag = gitem->flag ;
ginfo.name = gitem->name ;
ginfo.peerIds = gitem->pgpList.ids ;
ginfo.id = RsNodeGroupId::random() ;
do { ginfo.id = RsNodeGroupId::random(); } while(groupList.find(ginfo.id) != groupList.end()) ;
// Ensure backward compatibility when loading the group in old format. The id must matchthe standard default id.
@ -2484,7 +2485,8 @@ bool p3PeerMgrIMPL::addGroup(RsGroupInfo &groupInfo)
{
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
groupInfo.id = RsNodeGroupId::random() ;//groupItem->id; // at creation time, we generate a random id.
do { groupInfo.id = RsNodeGroupId::random(); } while(groupList.find(groupInfo.id) != groupList.end()) ;
RsGroupInfo groupItem(groupInfo) ;
// remove standard flag

View File

@ -305,6 +305,9 @@ void FriendSelectionWidget::secured_fillList()
else
rsPeers->getGPGAcceptedList(gpgIds);
// add own pgp id to the list
gpgIds.push_back(rsPeers->getGPGOwnId()) ;
std::list<RsPeerId> sslIds;
std::list<RsPeerId>::iterator sslIt;