reverted last commit. Fixed the perm bug in ConnectFreindWizard (Patch from Henry Morgan)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6316 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-04-19 11:54:39 +00:00
parent 3240b1f71b
commit ae5e1c7ae5
2 changed files with 15 additions and 9 deletions

View File

@ -515,13 +515,18 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
{
ServicePermissionFlags flags(0) ;
if (hasVisitedPage(Page_FriendRequest))
{
if(ui->_anonymous_routing_CB->isChecked()) flags |= RS_SERVICE_PERM_TURTLE ;
if( ui->_discovery_CB->isChecked()) flags |= RS_SERVICE_PERM_DISCOVERY ;
if( ui->_forums_channels_CB->isChecked()) flags |= RS_SERVICE_PERM_DISTRIB ;
} else if (hasVisitedPage(Page_Conclusion)) {
if(ui->_anonymous_routing_CB_2->isChecked()) flags |= RS_SERVICE_PERM_TURTLE ;
if( ui->_discovery_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DISCOVERY ;
if( ui->_forums_channels_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DISTRIB ;
}
return flags ;
}
void ConnectFriendWizard::accept()
{
bool sign = false;
@ -560,6 +565,7 @@ void ConnectFriendWizard::accept()
} else if (accept_connection) {
std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl;
rsPeers->addFriend("", peerDetails.gpg_id,serviceFlags()) ;
rsPeers->setServicePermissionFlags(peerDetails.gpg_id,serviceFlags()) ;
}
if (!groupId.isEmpty()) {

View File

@ -326,20 +326,20 @@ void SecurityItem::removeFriend()
rsPeers->removeFriend(mGpgId);
}
}
void SecurityItem::friendRequest()
{
#ifdef DEBUG_ITEM
std::cerr << "SecurityItem::friendReguest()";
std::cerr << std::endl;
#endif
ConfCertDialog::showIt(mGpgId, ConfCertDialog::PageTrust);
/* ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard;
ConnectFriendWizard *connectFriendWizard = new ConnectFriendWizard;
connectFriendWizard->setAttribute(Qt::WA_DeleteOnClose, true);
connectFriendWizard->setGpgId(mGpgId, true);
connectFriendWizard->show();*/
connectFriendWizard->show();
}
void SecurityItem::peerDetails()
{
#ifdef DEBUG_ITEM