mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-23 14:41:04 -04:00
- Added flags for services and service permissions for peers
Flags are identity-related, meaning that all locations of the same peers have the same flags. - It's now possible to tweak which services each peer can use. Service that can be disabled are forums/channels, discovery, anonymous routing. - by default, peers have all flags on. - fixed missing error msg in p3cfgmgr when serialisation fails. - fixed bug in RemoteDirModel causing infinite loop to happen when group name is unknown git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5924 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
099a3ad33e
commit
e3da77612a
24 changed files with 887 additions and 242 deletions
|
@ -222,6 +222,10 @@ void ConnectFriendWizard::initializePage(int id)
|
|||
{
|
||||
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
|
||||
|
||||
ui->_anonymous_routing_CB_2->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_TURTLE) ;
|
||||
ui->_discovery_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DISCOVERY) ;
|
||||
ui->_forums_channels_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DISTRIB) ;
|
||||
|
||||
//set the radio button to sign the GPG key
|
||||
if (peerDetails.accept_connection && !peerDetails.ownsign) {
|
||||
//gpg key connection is already accepted, don't propose to accept it again
|
||||
|
@ -489,6 +493,17 @@ int ConnectFriendWizard::nextId() const
|
|||
return -1;
|
||||
}
|
||||
|
||||
ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
|
||||
{
|
||||
ServicePermissionFlags flags(0) ;
|
||||
|
||||
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;
|
||||
|
@ -526,7 +541,7 @@ void ConnectFriendWizard::accept()
|
|||
rsPeers->signGPGCertificate(peerDetails.gpg_id); //bye default sign set accept_connection to true;
|
||||
} else if (accept_connection) {
|
||||
std::cerr << "ConclusionPage::validatePage() accepting GPG key for connection." << std::endl;
|
||||
rsPeers->addFriend("", peerDetails.gpg_id);
|
||||
rsPeers->addFriend("", peerDetails.gpg_id,serviceFlags()) ;
|
||||
}
|
||||
|
||||
if (!groupId.isEmpty()) {
|
||||
|
@ -535,7 +550,8 @@ void ConnectFriendWizard::accept()
|
|||
}
|
||||
|
||||
if (peerDetails.id != "") {
|
||||
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id);
|
||||
rsPeers->addFriend(peerDetails.id, peerDetails.gpg_id,serviceFlags()) ;
|
||||
|
||||
//let's check if there is ip adresses in the wizard.
|
||||
if (!peerDetails.extAddr.empty() && peerDetails.extPort) {
|
||||
std::cerr << "ConnectFriendWizard::accept() : setting ip ext address." << std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue