Merge pull request #286 from jolavillette/FixUseAsDirectSourceWhenAcceptingFriendViaActivityFeed

Fixed Use as direct source being automatically enabled when re-accepting a denied friend via Activity / Peer Details
This commit is contained in:
csoler 2026-05-23 19:20:27 +02:00 committed by GitHub
commit ec6fbf1328
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -1069,7 +1069,14 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg
mLinkMgr->addFriend(id, vs_dht != RS_VS_DHT_OFF);
}
service_flags &= servicePermissionFlags(gpg_id) ; // Always reduce the permissions.
{
RS_STACK_MUTEX(mPeerMtx);
auto it = mFriendsPermissionFlags.find(gpg_id);
if(it != mFriendsPermissionFlags.end())
{
service_flags &= it->second; // Always reduce the permissions for existing friends.
}
}
#ifdef RS_CHATSERVER //Defined by chatserver
setServicePermissionFlags(gpg_id,RS_NODE_PERM_NONE) ;
#else

View File

@ -98,7 +98,7 @@ const ServicePermissionFlags RS_NODE_PERM_NONE ( 0x00000000 ) ;// 0x1, 0x2
const ServicePermissionFlags RS_NODE_PERM_DIRECT_DL ( 0x00000008 ) ;// Accept to directly DL from this peer (breaks anonymity)
const ServicePermissionFlags RS_NODE_PERM_ALLOW_PUSH ( 0x00000010 ) ;// Auto-DL files recommended by this peer
const ServicePermissionFlags RS_NODE_PERM_REQUIRE_WL ( 0x00000020 ) ;// Require white list clearance for connection
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_DIRECT_DL ;
const ServicePermissionFlags RS_NODE_PERM_DEFAULT = RS_NODE_PERM_NONE ;
const ServicePermissionFlags RS_NODE_PERM_ALL = RS_NODE_PERM_DIRECT_DL | RS_NODE_PERM_ALLOW_PUSH | RS_NODE_PERM_REQUIRE_WL;
// ...