mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
added warnign when channel post shares files from extra list
This commit is contained in:
parent
7e7f56440c
commit
d4e5a2ea83
1 changed files with 21 additions and 1 deletions
|
|
@ -730,6 +730,7 @@ void CreateGxsChannelMsg::sendMsg()
|
||||||
|
|
||||||
std::list<RsGxsFile> files;
|
std::list<RsGxsFile> files;
|
||||||
std::list<RsGxsFile> missing_files;
|
std::list<RsGxsFile> missing_files;
|
||||||
|
std::list<RsGxsFile> files_only_extra;
|
||||||
|
|
||||||
for(auto fit :mAttachments)
|
for(auto fit :mAttachments)
|
||||||
if (!fit->isHidden())
|
if (!fit->isHidden())
|
||||||
|
|
@ -745,7 +746,14 @@ void CreateGxsChannelMsg::sendMsg()
|
||||||
|
|
||||||
if (!fit->done() && fit->ready()) // Skips unhashed files.
|
if (!fit->done() && fit->ready()) // Skips unhashed files.
|
||||||
missing_files.push_back(fi);
|
missing_files.push_back(fi);
|
||||||
}
|
|
||||||
|
FileInfo finfo;
|
||||||
|
bool extra = rsFiles->FileDetails(fi.mHash, RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_SPEC_ONLY, finfo );
|
||||||
|
bool local = rsFiles->FileDetails(fi.mHash, RS_FILE_HINTS_LOCAL | RS_FILE_HINTS_SPEC_ONLY, finfo );
|
||||||
|
|
||||||
|
if(extra && !local)
|
||||||
|
files_only_extra.push_back(fi);
|
||||||
|
}
|
||||||
|
|
||||||
if(!missing_files.empty())
|
if(!missing_files.empty())
|
||||||
{
|
{
|
||||||
|
|
@ -758,6 +766,18 @@ void CreateGxsChannelMsg::sendMsg()
|
||||||
tr("This post contains files that you are currently not sharing. Do you still want to post?")+filesstr,QMessageBox::Ok,QMessageBox::Cancel))
|
tr("This post contains files that you are currently not sharing. Do you still want to post?")+filesstr,QMessageBox::Ok,QMessageBox::Cancel))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(!files_only_extra.empty())
|
||||||
|
{
|
||||||
|
QString filesstr = "<br/>";
|
||||||
|
|
||||||
|
for(auto& file: files_only_extra)
|
||||||
|
filesstr += "<br/>" /*+QString::fromStdString(file.mHash.toStdString()) + " "*/ + QString::fromStdString(file.mName) ;
|
||||||
|
|
||||||
|
QMessageBox::information(nullptr,
|
||||||
|
tr("Post refers to temporary shared files"),
|
||||||
|
tr("The following files will only shared until you restart Retroshare. Think about adding them to a shared directory.")
|
||||||
|
+filesstr);
|
||||||
|
}
|
||||||
|
|
||||||
sendMessage(subject, msg, files);
|
sendMessage(subject, msg, files);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue