mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-15 10:00:51 -04:00
added new flag to allow peers auto-download recommended files from trusted neighbor nodes, which give the possibility to push data to other nodes
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7955 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d029dd0368
commit
d2c4c3bb09
15 changed files with 69 additions and 52 deletions
2
TODO.txt
2
TODO.txt
|
@ -27,7 +27,7 @@ E [ ] do we keep "Getting Started" ? the look needs to be improved
|
||||||
E [ ] Recommendation messages do not show complete links. Links show up in some buttons and the text is truncated
|
E [ ] Recommendation messages do not show complete links. Links show up in some buttons and the text is truncated
|
||||||
E [ ] Recommendation messages should not be signed by the retroshare team!!
|
E [ ] Recommendation messages should not be signed by the retroshare team!!
|
||||||
E [ ] when adding a friend through clicking on cert links, the add friend wizard is shown twice!
|
E [ ] when adding a friend through clicking on cert links, the add friend wizard is shown twice!
|
||||||
M [ ] add a flag in friends option to allow auto-download of recommended files
|
M [X] add a flag in friends option to allow auto-download of recommended files
|
||||||
|
|
||||||
Messages
|
Messages
|
||||||
H [ ] distant messages should be made async-ed
|
H [ ] distant messages should be made async-ed
|
||||||
|
|
|
@ -292,7 +292,7 @@ void ftController::searchForDirectSources()
|
||||||
|
|
||||||
if(mSearch->search(it->first, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info))
|
if(mSearch->search(it->first, RS_FILE_HINTS_REMOTE | RS_FILE_HINTS_SPEC_ONLY, info))
|
||||||
for(std::list<TransferInfo>::const_iterator pit = info.peers.begin(); pit != info.peers.end(); ++pit)
|
for(std::list<TransferInfo>::const_iterator pit = info.peers.begin(); pit != info.peers.end(); ++pit)
|
||||||
if(rsPeers->servicePermissionFlags(pit->peerId) & RS_SERVICE_PERM_DIRECT_DL)
|
if(rsPeers->servicePermissionFlags(pit->peerId) & RS_NODE_PERM_DIRECT_DL)
|
||||||
if(it->second->mTransfer->addFileSource(pit->peerId)) /* if the sources don't exist already - add in */
|
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, mServiceCtrl->isPeerConnected(mFtServiceId, pit->peerId));
|
setPeerState(it->second->mTransfer, pit->peerId, FT_CNTRL_STANDARD_RATE, mServiceCtrl->isPeerConnected(mFtServiceId, pit->peerId));
|
||||||
}
|
}
|
||||||
|
@ -1134,7 +1134,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||||
//
|
//
|
||||||
if(!(flags & RS_FILE_REQ_CACHE))
|
if(!(flags & RS_FILE_REQ_CACHE))
|
||||||
for(std::list<RsPeerId>::iterator it = srcIds.begin(); it != srcIds.end(); )
|
for(std::list<RsPeerId>::iterator it = srcIds.begin(); it != srcIds.end(); )
|
||||||
if(!(rsPeers->servicePermissionFlags(*it) & RS_SERVICE_PERM_DIRECT_DL))
|
if(!(rsPeers->servicePermissionFlags(*it) & RS_NODE_PERM_DIRECT_DL))
|
||||||
{
|
{
|
||||||
std::list<RsPeerId>::iterator tmp(it) ;
|
std::list<RsPeerId>::iterator tmp(it) ;
|
||||||
++tmp ;
|
++tmp ;
|
||||||
|
@ -1190,7 +1190,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(it = srcIds.begin(); it != srcIds.end(); ++it)
|
for(it = srcIds.begin(); it != srcIds.end(); ++it)
|
||||||
if(rsPeers->servicePermissionFlags(*it) & RS_SERVICE_PERM_DIRECT_DL)
|
if(rsPeers->servicePermissionFlags(*it) & RS_NODE_PERM_DIRECT_DL)
|
||||||
{
|
{
|
||||||
uint32_t i, j;
|
uint32_t i, j;
|
||||||
if ((dit->second)->mTransfer->getPeerState(*it, i, j))
|
if ((dit->second)->mTransfer->getPeerState(*it, i, j))
|
||||||
|
@ -1245,7 +1245,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||||
#endif
|
#endif
|
||||||
// Because this is auto-add, we only add sources that we allow to DL from using direct transfers.
|
// Because this is auto-add, we only add sources that we allow to DL from using direct transfers.
|
||||||
|
|
||||||
if ((srcIds.end() == std::find( srcIds.begin(), srcIds.end(), pit->peerId)) && (RS_SERVICE_PERM_DIRECT_DL & rsPeers->servicePermissionFlags(pit->peerId)))
|
if ((srcIds.end() == std::find( srcIds.begin(), srcIds.end(), pit->peerId)) && (RS_NODE_PERM_DIRECT_DL & rsPeers->servicePermissionFlags(pit->peerId)))
|
||||||
{
|
{
|
||||||
srcIds.push_back(pit->peerId);
|
srcIds.push_back(pit->peerId);
|
||||||
|
|
||||||
|
|
|
@ -1700,7 +1700,7 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
/* ************* */
|
/* ************* */
|
||||||
addFriend(peer_id, peer_pgp_id, pitem->netMode, pitem->vs_disc, pitem->vs_dht, pitem->lastContact, RS_SERVICE_PERM_ALL);
|
addFriend(peer_id, peer_pgp_id, pitem->netMode, pitem->vs_disc, pitem->vs_dht, pitem->lastContact, RS_NODE_PERM_DEFAULT);
|
||||||
setLocation(pitem->peerId, pitem->location);
|
setLocation(pitem->peerId, pitem->location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2135,7 +2135,7 @@ ServicePermissionFlags p3PeerMgrIMPL::servicePermissionFlags(const RsPeerId& ssl
|
||||||
std::map<RsPeerId, peerState>::const_iterator it = mFriendList.find(ssl_id);
|
std::map<RsPeerId, peerState>::const_iterator it = mFriendList.find(ssl_id);
|
||||||
|
|
||||||
if(it == mFriendList.end())
|
if(it == mFriendList.end())
|
||||||
return RS_SERVICE_PERM_ALL ;
|
return RS_NODE_PERM_DEFAULT ;
|
||||||
|
|
||||||
gpg_id = it->second.gpg_id ;
|
gpg_id = it->second.gpg_id ;
|
||||||
}
|
}
|
||||||
|
@ -2152,7 +2152,7 @@ ServicePermissionFlags p3PeerMgrIMPL::servicePermissionFlags(const RsPgpId& pgp_
|
||||||
std::map<RsPgpId,ServicePermissionFlags>::const_iterator it = mFriendsPermissionFlags.find( pgp_id ) ;
|
std::map<RsPgpId,ServicePermissionFlags>::const_iterator it = mFriendsPermissionFlags.find( pgp_id ) ;
|
||||||
|
|
||||||
if(it == mFriendsPermissionFlags.end())
|
if(it == mFriendsPermissionFlags.end())
|
||||||
return RS_SERVICE_PERM_ALL ;
|
return RS_NODE_PERM_DEFAULT ;
|
||||||
else
|
else
|
||||||
return it->second ;
|
return it->second ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ virtual ~p3PeerMgr() { return; }
|
||||||
|
|
||||||
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id, uint32_t netMode = RS_NET_MODE_UDP,
|
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id, uint32_t netMode = RS_NET_MODE_UDP,
|
||||||
uint16_t vsDisc = RS_VS_DISC_FULL, uint16_t vsDht = RS_VS_DHT_FULL,
|
uint16_t vsDisc = RS_VS_DISC_FULL, uint16_t vsDht = RS_VS_DHT_FULL,
|
||||||
time_t lastContact = 0,ServicePermissionFlags = ServicePermissionFlags(RS_SERVICE_PERM_ALL)) = 0;
|
time_t lastContact = 0,ServicePermissionFlags = ServicePermissionFlags(RS_NODE_PERM_DEFAULT)) = 0;
|
||||||
virtual bool removeFriend(const RsPeerId &ssl_id, bool removePgpId) = 0;
|
virtual bool removeFriend(const RsPeerId &ssl_id, bool removePgpId) = 0;
|
||||||
|
|
||||||
virtual bool isFriend(const RsPeerId& ssl_id) = 0;
|
virtual bool isFriend(const RsPeerId& ssl_id) = 0;
|
||||||
|
@ -217,7 +217,7 @@ class p3PeerMgrIMPL: public p3PeerMgr, public p3Config
|
||||||
|
|
||||||
virtual bool addFriend(const RsPeerId&ssl_id, const RsPgpId&gpg_id, uint32_t netMode = RS_NET_MODE_UDP,
|
virtual bool addFriend(const RsPeerId&ssl_id, const RsPgpId&gpg_id, uint32_t netMode = RS_NET_MODE_UDP,
|
||||||
uint16_t vsDisc = RS_VS_DISC_FULL, uint16_t vsDht = RS_VS_DHT_FULL,
|
uint16_t vsDisc = RS_VS_DISC_FULL, uint16_t vsDht = RS_VS_DHT_FULL,
|
||||||
time_t lastContact = 0,ServicePermissionFlags = ServicePermissionFlags(RS_SERVICE_PERM_ALL));
|
time_t lastContact = 0,ServicePermissionFlags = ServicePermissionFlags(RS_NODE_PERM_DEFAULT));
|
||||||
virtual bool removeFriend(const RsPeerId &ssl_id, bool removePgpId);
|
virtual bool removeFriend(const RsPeerId &ssl_id, bool removePgpId);
|
||||||
virtual bool removeFriend(const RsPgpId &pgp_id);
|
virtual bool removeFriend(const RsPgpId &pgp_id);
|
||||||
|
|
||||||
|
|
|
@ -75,9 +75,11 @@ const uint32_t RS_PEER_STATE_UNREACHABLE= 0x0008;
|
||||||
|
|
||||||
// Service option flags.
|
// Service option flags.
|
||||||
//
|
//
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_NONE ( 0x00000000 ) ;
|
const ServicePermissionFlags RS_NODE_PERM_NONE ( 0x00000000 ) ;// 0x1, 0x2 and Ox4 are deprecated.
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_DIRECT_DL ( 0x00000008 ) ;
|
const ServicePermissionFlags RS_NODE_PERM_DIRECT_DL ( 0x00000008 ) ;// Accept to directly DL from this peer (breaks anonymity)
|
||||||
const ServicePermissionFlags RS_SERVICE_PERM_ALL = RS_SERVICE_PERM_DIRECT_DL ;
|
const ServicePermissionFlags RS_NODE_PERM_ALLOW_PUSH ( 0x00000010 ) ;// Auto-DL files recommended by this peer
|
||||||
|
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_DIRECT_DL ;
|
||||||
|
const ServicePermissionFlags RS_NODE_PERM_ALL = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_ALLOW_PUSH;
|
||||||
|
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
|
@ -321,7 +323,7 @@ class RsPeers
|
||||||
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) = 0;
|
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) = 0;
|
||||||
|
|
||||||
/* Add/Remove Friends */
|
/* Add/Remove Friends */
|
||||||
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL) = 0;
|
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_NODE_PERM_DEFAULT) = 0;
|
||||||
virtual bool removeFriend(const RsPgpId& pgp_id) = 0;
|
virtual bool removeFriend(const RsPgpId& pgp_id) = 0;
|
||||||
virtual bool removeFriendLocation(const RsPeerId& sslId) = 0;
|
virtual bool removeFriendLocation(const RsPeerId& sslId) = 0;
|
||||||
|
|
||||||
|
|
|
@ -1087,7 +1087,7 @@ bool p3Peers::loadDetailsFromStringCert(const std::string &certstr, RsPeerDetai
|
||||||
pd.location = cert.location_name_string();
|
pd.location = cert.location_name_string();
|
||||||
|
|
||||||
pd.isOnlyGPGdetail = pd.id.isNull();
|
pd.isOnlyGPGdetail = pd.id.isNull();
|
||||||
pd.service_perm_flags = RS_SERVICE_PERM_ALL ;
|
pd.service_perm_flags = RS_NODE_PERM_DEFAULT ;
|
||||||
|
|
||||||
if (!cert.hidden_node_string().empty())
|
if (!cert.hidden_node_string().empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,7 +75,7 @@ virtual bool getAssociatedSSLIds(const RsPgpId& gpg_id, std::list<RsPeerId> &ids
|
||||||
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) ;
|
virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen) ;
|
||||||
|
|
||||||
/* Add/Remove Friends */
|
/* Add/Remove Friends */
|
||||||
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_SERVICE_PERM_ALL);
|
virtual bool addFriend(const RsPeerId &ssl_id, const RsPgpId &gpg_id,ServicePermissionFlags flags = RS_NODE_PERM_DEFAULT);
|
||||||
virtual bool removeFriend(const RsPgpId& gpgid);
|
virtual bool removeFriend(const RsPgpId& gpgid);
|
||||||
virtual bool removeFriendLocation(const RsPeerId& sslId);
|
virtual bool removeFriendLocation(const RsPeerId& sslId);
|
||||||
|
|
||||||
|
|
|
@ -911,7 +911,7 @@ void p3discovery2::processContactInfo(const SSLID &fromId, const RsDiscContactIt
|
||||||
#ifdef P3DISC_DEBUG
|
#ifdef P3DISC_DEBUG
|
||||||
std::cerr << "--> Adding to friends list " << item->sslId << " - " << item->pgpId << std::endl;
|
std::cerr << "--> Adding to friends list " << item->sslId << " - " << item->pgpId << std::endl;
|
||||||
#endif
|
#endif
|
||||||
mPeerMgr->addFriend(item->sslId, item->pgpId, item->netMode, RS_VS_DISC_OFF, RS_VS_DHT_FULL,(time_t)0,RS_SERVICE_PERM_ALL);
|
mPeerMgr->addFriend(item->sslId, item->pgpId, item->netMode, RS_VS_DISC_OFF, RS_VS_DHT_FULL,(time_t)0,RS_NODE_PERM_DEFAULT);
|
||||||
updatePeerAddresses(item);
|
updatePeerAddresses(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,13 @@ void p3MsgService::processMsg(RsMsgItem *mi, bool incoming)
|
||||||
mSrcIds.insert(std::pair<uint32_t, RsMsgSrcId*>(msi->msgId, msi));
|
mSrcIds.insert(std::pair<uint32_t, RsMsgSrcId*>(msi->msgId, msi));
|
||||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||||
}
|
}
|
||||||
|
// If the peer is allowed to push files, then auto-download the recommended files.
|
||||||
|
|
||||||
|
if(rsPeers->servicePermissionFlags(mi->PeerId()) & RS_NODE_PERM_ALLOW_PUSH)
|
||||||
|
for(std::list<RsTlvFileItem>::const_iterator it(mi->attachment.items.begin());it!=mi->attachment.items.end();++it)
|
||||||
|
rsFiles->FileRequest((*it).name,(*it).hash,(*it).filesize,std::string(),RS_FILE_REQ_ANONYMOUS_ROUTING,std::list<RsPeerId>()) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_ADD);
|
RsServer::notify()->notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_ADD);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ ServicePermissionDialog::ServicePermissionDialog() :
|
||||||
Settings->loadWidgetInformation(this);
|
Settings->loadWidgetInformation(this);
|
||||||
|
|
||||||
ui->headerFrame->setHeaderImage(QPixmap(":/images/user/servicepermissions64.png"));
|
ui->headerFrame->setHeaderImage(QPixmap(":/images/user/servicepermissions64.png"));
|
||||||
ui->headerFrame->setHeaderText(tr("Service Permissions"));
|
ui->headerFrame->setHeaderText(tr("Service Permissions"));
|
||||||
|
|
||||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(setPermissions()));
|
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(setPermissions()));
|
||||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
@ -49,9 +49,12 @@ ServicePermissionDialog::ServicePermissionDialog() :
|
||||||
ui->servicePermissionList->setModus(FriendSelectionWidget::MODUS_SINGLE);
|
ui->servicePermissionList->setModus(FriendSelectionWidget::MODUS_SINGLE);
|
||||||
ui->servicePermissionList->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_GPG);
|
ui->servicePermissionList->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_GPG);
|
||||||
|
|
||||||
/* add columns */
|
/* add columns */
|
||||||
int column = ui->servicePermissionList->addColumn(tr("Use as direct source, when available"));
|
int column ;
|
||||||
mColumns[column] = RS_SERVICE_PERM_DIRECT_DL;
|
column = ui->servicePermissionList->addColumn(tr("Use as direct source, when available"));
|
||||||
|
mColumns[column] = RS_NODE_PERM_DIRECT_DL;
|
||||||
|
column = ui->servicePermissionList->addColumn(tr("Auto-download recommended files"));
|
||||||
|
mColumns[column] = RS_NODE_PERM_ALLOW_PUSH;
|
||||||
|
|
||||||
ui->servicePermissionList->start();
|
ui->servicePermissionList->start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,8 @@ void ConfCertDialog::setServiceFlags()
|
||||||
{
|
{
|
||||||
ServicePermissionFlags flags(0) ;
|
ServicePermissionFlags flags(0) ;
|
||||||
|
|
||||||
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_SERVICE_PERM_DIRECT_DL ;
|
if( ui._direct_transfer_CB->isChecked()) flags = flags | RS_NODE_PERM_DIRECT_DL ;
|
||||||
|
if( ui._allow_push_CB->isChecked()) flags = flags | RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
|
|
||||||
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
rsPeers->setServicePermissionFlags(pgpId,flags) ;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +176,8 @@ void ConfCertDialog::load()
|
||||||
ui.make_friend_button->setToolTip("") ;
|
ui.make_friend_button->setToolTip("") ;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL ) ;
|
ui._direct_transfer_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_DIRECT_DL ) ;
|
||||||
|
ui._allow_push_CB->setChecked( detail.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||||
|
|
||||||
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
|
ui.name->setText(QString::fromUtf8(detail.name.c_str()));
|
||||||
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
ui.peerid->setText(QString::fromStdString(detail.id.toStdString()));
|
||||||
|
|
|
@ -813,7 +813,7 @@ p, li { white-space: pre-wrap; }
|
||||||
<string>Options</string>
|
<string>Options</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="2" column="0" colspan="2">
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="verticalSpacer_4">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -836,6 +836,13 @@ p, li { white-space: pre-wrap; }
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="_allow_push_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto-download recommended files from this node</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -256,7 +256,8 @@ void ConnectFriendWizard::initializePage(int id)
|
||||||
{
|
{
|
||||||
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
|
std::cerr << "Conclusion page id : " << peerDetails.id << "; gpg_id : " << peerDetails.gpg_id << std::endl;
|
||||||
|
|
||||||
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_SERVICE_PERM_DIRECT_DL) ;
|
ui->_direct_transfer_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_DIRECT_DL) ;
|
||||||
|
ui->_allow_push_CB_2 ->setChecked(peerDetails.service_perm_flags & RS_NODE_PERM_ALLOW_PUSH) ;
|
||||||
|
|
||||||
RsPeerDetails tmp_det ;
|
RsPeerDetails tmp_det ;
|
||||||
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
|
bool already_in_keyring = rsPeers->getGPGDetails(peerDetails.gpg_id, tmp_det) ;
|
||||||
|
@ -620,9 +621,11 @@ ServicePermissionFlags ConnectFriendWizard::serviceFlags() const
|
||||||
|
|
||||||
if (hasVisitedPage(Page_FriendRequest))
|
if (hasVisitedPage(Page_FriendRequest))
|
||||||
{
|
{
|
||||||
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
if( ui->_direct_transfer_CB->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
||||||
|
if( ui->_allow_push_CB->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
} else if (hasVisitedPage(Page_Conclusion)) {
|
} else if (hasVisitedPage(Page_Conclusion)) {
|
||||||
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_SERVICE_PERM_DIRECT_DL ;
|
if( ui->_direct_transfer_CB_2->isChecked()) flags |= RS_NODE_PERM_DIRECT_DL ;
|
||||||
|
if( ui->_allow_push_CB_2->isChecked()) flags |= RS_NODE_PERM_ALLOW_PUSH ;
|
||||||
}
|
}
|
||||||
return flags ;
|
return flags ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>662</width>
|
<width>662</width>
|
||||||
<height>623</height>
|
<height>650</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -687,6 +687,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="_allow_push_CB">
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto-download recommended files</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_5">
|
<spacer name="verticalSpacer_5">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -996,34 +1003,20 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Service permissions</string>
|
<string>Options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="_direct_transfer_CB_2">
|
<widget class="QCheckBox" name="_direct_transfer_CB_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Direct source</string>
|
<string>Can be used as direct source</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="_discovery_CB_2">
|
<widget class="QCheckBox" name="_allow_push_CB_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Discovery</string>
|
<string>Auto-download recommended files</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="_forums_channels_CB_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Forums/channels</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="_anonymous_routing_CB_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Anonymous routing</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1093,17 +1086,17 @@
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>StyledLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>gui/common/StyledLabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>AvatarWidget</class>
|
<class>AvatarWidget</class>
|
||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>gui/common/AvatarWidget.h</header>
|
<header>gui/common/AvatarWidget.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>StyledLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>gui/common/StyledLabel.h</header>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>FriendSelectionWidget</class>
|
<class>FriendSelectionWidget</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
|
|
|
@ -153,7 +153,7 @@ int RpcProtoPeers::processAddPeer(uint32_t chan_id, uint32_t /* msg_id */, uint3
|
||||||
case rsctrl::peers::RequestAddPeer::ADD:
|
case rsctrl::peers::RequestAddPeer::ADD:
|
||||||
|
|
||||||
// TODO. NEED TO HANDLE SERVICE PERMISSION FLAGS.
|
// TODO. NEED TO HANDLE SERVICE PERMISSION FLAGS.
|
||||||
success = rsPeers->addFriend(ssl_id,pgp_id, RS_SERVICE_PERM_ALL);
|
success = rsPeers->addFriend(ssl_id,pgp_id, RS_NODE_PERM_DEFAULT);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case rsctrl::peers::RequestAddPeer::REMOVE:
|
case rsctrl::peers::RequestAddPeer::REMOVE:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue