mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-24 00:31:32 -04:00
First shot of file sharing permissions. Compiles, but needs some testing/debugging.
- added type-safe flags in retroshare/rsflags.h. This should be used to make new flags types in order to prevent mixing flags up in function prototypes. - group handling is left to rsPeers. We'll move it to rsCircles later. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-FileSharingPermissions@5754 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
03d4936b12
commit
dc82cee700
27 changed files with 567 additions and 336 deletions
|
@ -129,6 +129,11 @@ ftFiMonitor::ftFiMonitor(CacheStrapper *cs,NotifyBase *cb_in, std::string cached
|
|||
}
|
||||
|
||||
bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, FileInfo &info) const
|
||||
{
|
||||
std::cerr << "(EE) ********* ftFiMonitor expects a peer id in search()!" << std::endl;
|
||||
return false ;
|
||||
}
|
||||
bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, const std::string& peer_id,FileInfo &info) const
|
||||
{
|
||||
uint64_t fsize;
|
||||
std::string path;
|
||||
|
@ -144,7 +149,7 @@ bool ftFiMonitor::search(const std::string &hash, uint32_t hintflags, FileInfo &
|
|||
//
|
||||
uint32_t flags = hintflags & (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE);
|
||||
|
||||
if(findLocalFile(hash, flags, path, fsize))
|
||||
if(findLocalFile(hash, flags,peer_id,path, fsize))
|
||||
{
|
||||
/* fill in details */
|
||||
#ifdef DB_DEBUG
|
||||
|
@ -288,6 +293,7 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
/* for each item, check it exists ....
|
||||
* - remove any that are dead (or flag?)
|
||||
*/
|
||||
static const uint32_t PERMISSION_MASK = DIR_FLAGS_BROWSABLE_OTHERS | DIR_FLAGS_NETWORK_WIDE_OTHERS | DIR_FLAGS_BROWSABLE_GROUPS | DIR_FLAGS_NETWORK_WIDE_GROUPS ;
|
||||
|
||||
#ifdef DEBUG_ELIST
|
||||
std::cerr << "ftFiMonitor::loadList()";
|
||||
|
@ -341,7 +347,7 @@ bool ftFiMonitor::loadList(std::list<RsItem *>& load)
|
|||
SharedDirInfo info ;
|
||||
info.filename = RsDirUtil::convertPathToUnix(fi->file.path);
|
||||
info.virtualname = fi->file.name;
|
||||
info.shareflags = fi->flags & (RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE) ;
|
||||
info.shareflags = fi->flags & PERMISSION_MASK ;
|
||||
|
||||
dirList.push_back(info) ;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue