mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 11:02:30 -04:00
Expose JSON API for file filtering
This commit is contained in:
parent
2556af692e
commit
406822b5ec
4 changed files with 57 additions and 22 deletions
|
@ -1913,11 +1913,11 @@ bool p3FileDatabase::banFile(const RsFileHash& real_file_hash, const std::string
|
|||
RS_STACK_MUTEX(mFLSMtx) ;
|
||||
BannedFileEntry& entry(mPrimaryBanList[real_file_hash]) ; // primary list (user controlled) of files banned from FT search and forwarding. map<real hash, BannedFileEntry>
|
||||
|
||||
if(entry.ban_time_stamp == 0)
|
||||
if(entry.mBanTimeStamp == 0)
|
||||
{
|
||||
entry.filename = filename ;
|
||||
entry.size = file_size ;
|
||||
entry.ban_time_stamp = time(NULL);
|
||||
entry.mFilename = filename ;
|
||||
entry.mSize = file_size ;
|
||||
entry.mBanTimeStamp = time(NULL);
|
||||
|
||||
RsFileHash hash_of_hash ;
|
||||
ftServer::encryptHash(real_file_hash,hash_of_hash) ;
|
||||
|
|
|
@ -50,12 +50,7 @@ void RsFileListsBannedHashesConfigItem::serial_process(RsGenericSerializer::Seri
|
|||
{
|
||||
RsTypeSerializer::serial_process(j,ctx,primary_banned_files_list,"primary_banned_files_list") ;
|
||||
}
|
||||
template<> void RsTypeSerializer::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx,BannedFileEntry& entry,const std::string& /*name*/)
|
||||
{
|
||||
RsTypeSerializer::serial_process (j,ctx,TLV_TYPE_STR_NAME,entry.filename ,"entry.file_name") ;
|
||||
RsTypeSerializer::serial_process<uint64_t>(j,ctx, entry.size ,"entry.size") ;
|
||||
RsTypeSerializer::serial_process<time_t> (j,ctx, entry.ban_time_stamp,"entry.ban_time_stamp") ;
|
||||
}
|
||||
|
||||
RsItem *RsFileListsSerialiser::create_item(uint16_t service,uint8_t type) const
|
||||
{
|
||||
if(service != RS_SERVICE_TYPE_FILE_DATABASE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue