diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 14b0359de..f462e0e34 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -56,6 +56,7 @@ #include "pqi/pqinotify.h" #include "retroshare/rsiface.h" +#include "retroshare/rspeers.h" #include "serialiser/rsconfigitems.h" #include @@ -293,8 +294,9 @@ void ftController::searchForDirectSources() if(mSearch->search(it->first, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info)) for(std::list::const_iterator pit = info.peers.begin(); pit != info.peers.end(); pit++) - if(it->second->mTransfer->addFileSource(pit->peerId)) /* if the sources don't exist already - add in */ - setPeerState(it->second->mTransfer, pit->peerId, FT_CNTRL_STANDARD_RATE, mLinkMgr->isOnline( pit->peerId )); + if(rsPeers->servicePermissionFlags_sslid(pit->peerId) & RS_SERVICE_PERM_DIRECT_DL) + if(it->second->mTransfer->addFileSource(pit->peerId)) /* if the sources don't exist already - add in */ + setPeerState(it->second->mTransfer, pit->peerId, FT_CNTRL_STANDARD_RATE, mLinkMgr->isOnline( pit->peerId )); } } diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index cf6be359f..40ef42aa0 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -72,7 +72,9 @@ const ServicePermissionFlags RS_SERVICE_PERM_NONE ( 0x00000000 ) ; const ServicePermissionFlags RS_SERVICE_PERM_TURTLE ( 0x00000001 ) ; const ServicePermissionFlags RS_SERVICE_PERM_DISCOVERY ( 0x00000002 ) ; const ServicePermissionFlags RS_SERVICE_PERM_DISTRIB ( 0x00000004 ) ; -const ServicePermissionFlags RS_SERVICE_PERM_ALL = RS_SERVICE_PERM_TURTLE | RS_SERVICE_PERM_DISCOVERY | RS_SERVICE_PERM_DISTRIB ; +const ServicePermissionFlags RS_SERVICE_PERM_DIRECT_DL ( 0x00000008 ) ; +const ServicePermissionFlags RS_SERVICE_PERM_ALL = RS_SERVICE_PERM_TURTLE | RS_SERVICE_PERM_DISCOVERY + | RS_SERVICE_PERM_DISTRIB | RS_SERVICE_PERM_DIRECT_DL; // ... /* Connect state */ diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 39841ad58..69f4ff698 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -137,6 +137,7 @@ void ConfCertDialog::setServiceFlags() if(ui._anonymous_routing_CB->isChecked()) flags = flags | RS_SERVICE_PERM_TURTLE ; if( ui._discovery_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DISCOVERY ; if( ui._forums_channels_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DISTRIB ; + if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DIRECT_DL ; rsPeers->setServicePermissionFlags(detail.gpg_id,flags) ; } @@ -175,6 +176,7 @@ void ConfCertDialog::load() ui._anonymous_routing_CB->setChecked(detail.service_perm_flags & RS_SERVICE_PERM_TURTLE ) ; ui._discovery_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DISCOVERY ) ; ui._forums_channels_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DISTRIB ) ; + ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL ) ; ui.name->setText(QString::fromUtf8(detail.name.c_str())); ui.peerid->setText(QString::fromStdString(detail.id)); diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui index 856194534..19db61b77 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui @@ -60,7 +60,7 @@ - 0 + 3 @@ -800,7 +800,7 @@ Some services (Discovery, anonymous routing) can be switched off globally, which - <html><head/><body><p>Disabling anonymous routing will suppress all sending/retrieval of tunnel and anonymous search requests from/to this user. This user will not be able to transfer anonymously through you.</p><p>For a global switch, go to the server configuration panel.</p></body></html> + <html><head/><body><p align="justify">Disabling anonymous routing will suppress all sending/retrieval of tunnel and anonymous search requests from/to this user. This user will not be able to transfer anonymously through you.</p><p align="justify">For a global switch, go to the server configuration panel.</p></body></html> Anonymous routing @@ -810,7 +810,7 @@ Some services (Discovery, anonymous routing) can be switched off globally, which - <html><head/><body><p>Disabling discovery removes the sending of public keys of your own friends to this user. Discovery information from this friend will be dropped as well.</p><p>For a global switch, go to the server configuration panel.</p></body></html> + <html><head/><body><p align="justify">Disabling discovery removes the sending of public keys of your own friends to this user. Discovery information from this friend will be dropped as well.</p><p align="justify">For a global switch, go to the server configuration panel.</p></body></html> Discovery @@ -820,14 +820,14 @@ Some services (Discovery, anonymous routing) can be switched off globally, which - <html><head/><body><p>Disabling this means that forums and channels posts will not be passed from you to this friend, and items coming from this friend will be dropped.</p></body></html> + <html><head/><body><p align="justify">Disabling this means that forums and channels posts will not be passed from you to this friend, and items coming from this friend will be dropped.</p></body></html> Forums/Channels - + false @@ -840,7 +840,7 @@ Some services (Discovery, anonymous routing) can be switched off globally, which - + Qt::Vertical @@ -853,6 +853,16 @@ Some services (Discovery, anonymous routing) can be switched off globally, which + + + + <html><head/><body><p align="justify">Retroshare always periodically your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. </p></body></html> + + + Use as direct source, when available + + + diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index e470510ca..99c6be9c7 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -243,6 +243,7 @@ void ConnectFriendWizard::initializePage(int id) 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) ; + ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL) ; //set the radio button to sign the GPG key if (peerDetails.accept_connection && !peerDetails.ownsign) { @@ -520,10 +521,12 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const 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 ; + if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ; } 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 ; + if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ; } return flags ; } diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui index 8beb9b8a1..5f147c355 100644 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui @@ -7,7 +7,7 @@ 0 0 603 - 474 + 624 @@ -701,6 +701,13 @@ + + + + Use as direct source, when available + + + @@ -919,6 +926,13 @@ + + + + Direct source + + +