Skip to content
Snippets Groups Projects
Commit 196e4be1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

If the menu file download.* exists, display it before any download-protocol

selection menu. This allows the sysop to display additional download-file
specific instructions (e.g. http URL).

When using sendfile() to send a file *not* in a filebase, current_file will ==
nullptr and the download.* file won't be displayed.
parent 1dde501f
No related branches found
No related tags found
No related merge requests found
......@@ -453,7 +453,9 @@ bool sbbs_t::sendfile(file_t* f, char prot, bool autohang)
SAFEPRINTF2(str, "from %s %s"
,cfg.lib[cfg.dir[f->dir]->lib]->sname
,cfg.dir[f->dir]->sname);
current_file = f;
bool result = sendfile(getfilepath(&cfg, f, path), prot, str, autohang);
current_file = nullptr;
if(result == true) {
if(cfg.dir[f->dir]->misc&DIR_TFREE && cur_cps)
starttime += f->size / (ulong)cur_cps;
......
......@@ -1096,6 +1096,8 @@ const char* prot_menu_file[] = {
char* sbbs_t::xfer_prot_menu(enum XFER_TYPE type, user_t* user, char* keys, size_t size)
{
if(type == XFER_DOWNLOAD && current_file != nullptr)
menu("download", P_NOERROR);
size_t count = 0;
bool menu_used = menu(prot_menu_file[type], P_NOERROR);
if(user == nullptr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment