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

View File

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