Skip to content

Commit 76b3363

Browse files
committed
Fixed Use as direct source being automatically enabled when re-accepting a denied friend via Activity / Peer Details
1 parent c40adad commit 76b3363

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/pqi/p3peermgr.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,14 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
10691069
mLinkMgr->addFriend(id, vs_dht != RS_VS_DHT_OFF);
10701070
}
10711071

1072-
service_flags &= servicePermissionFlags(gpg_id) ; // Always reduce the permissions.
1072+
{
1073+
RS_STACK_MUTEX(mPeerMtx);
1074+
auto it = mFriendsPermissionFlags.find(gpg_id);
1075+
if(it != mFriendsPermissionFlags.end())
1076+
{
1077+
service_flags &= it->second; // Always reduce the permissions for existing friends.
1078+
}
1079+
}
10731080
#ifdef RS_CHATSERVER //Defined by chatserver
10741081
setServicePermissionFlags(gpg_id,RS_NODE_PERM_NONE) ;
10751082
#else

src/retroshare/rspeers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const ServicePermissionFlags RS_NODE_PERM_NONE ( 0x00000000 ) ;// 0x1, 0x2
9898
const ServicePermissionFlags RS_NODE_PERM_DIRECT_DL ( 0x00000008 ) ;// Accept to directly DL from this peer (breaks anonymity)
9999
const ServicePermissionFlags RS_NODE_PERM_ALLOW_PUSH ( 0x00000010 ) ;// Auto-DL files recommended by this peer
100100
const ServicePermissionFlags RS_NODE_PERM_REQUIRE_WL ( 0x00000020 ) ;// Require white list clearance for connection
101-
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_DIRECT_DL ;
101+
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_NONE ;
102102
const ServicePermissionFlags RS_NODE_PERM_ALL = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_ALLOW_PUSH | RS_NODE_PERM_REQUIRE_WL;
103103

104104
// ...

0 commit comments

Comments
 (0)