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

Add 2 additional arguments to FileAlreadyOnline text.dat string

... the library and directory (short) names

Making it more obvious *where* the referenced file has already been uploaded.
parent 6e713da3
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,7 @@
"\r\n\1r\1h\1iThat file is not on disk!\1n\r\n" 209 FileNotOnDisk
"\r\n\1r\1h\1iPlease upload files with the following "\ 210 TheseFileExtsOnly
"extensions only:\1n\r\n\1w\1h"
"\r\n\1r\1h\1i%s has already been uploaded!\1n\r\n" 211 FileAlreadyOnline
"\r\n\1n\1h%s\1r\1h\1i has already been uploaded to\1n\1c %s \1h%s\1n\r\n" 211 FileAlreadyOnline
"\r\n\1w\1hHit [ENTER] after last destination "\ 212 EnterAfterLastDestUser
"user.\r\n\r\n"
"\1_\1y\1hSend file to (User name or number): \1n" 213 SendFileToUser
......
......@@ -548,7 +548,7 @@ void sbbs_t::batch_upload()
SAFEPRINTF2(src, "%s%s", cfg.temp_dir, filename);
SAFEPRINTF2(dest, "%s%s", cfg.dir[dir]->path, filename);
if(fexistcase(src) && fexistcase(dest)) { /* file's in two places */
bprintf(text[FileAlreadyThere], filename);
bprintf(text[FileAlreadyOnline], filename, lib_name(dir), dir_name(dir));
remove(src); /* this is the one received */
continue;
}
......@@ -581,7 +581,9 @@ void sbbs_t::batch_upload()
}
SAFEPRINTF2(dest, "%s%s", cfg.dir[cfg.upload_dir]->path, dirent->d_name);
if(fexistcase(dest)) {
bprintf(text[FileAlreadyOnline], dirent->d_name);
bprintf(text[FileAlreadyOnline], dirent->d_name
,lib_name(cfg.upload_dir)
,dir_name(cfg.upload_dir));
continue;
}
if(mv(src, dest, /* copy: */false))
......@@ -599,7 +601,8 @@ void sbbs_t::batch_upload()
}
bputs(text[SearchedForDupes]);
if(x<usrlibs) {
bprintf(text[FileAlreadyOnline], dirent->d_name);
bprintf(text[FileAlreadyOnline], dirent->d_name
,lib_name(usrdir[x][y]), dir_name(usrdir[x][y]));
} else {
file_t f = {{}};
f.dir = cfg.upload_dir;
......
......@@ -234,7 +234,7 @@ bool sbbs_t::movefile(smb_t* smb, file_t* f, int newdir)
{
file_t newfile = *f;
if(findfile(&cfg, newdir, f->name, NULL)) {
bprintf(text[FileAlreadyThere], f->name);
bprintf(text[FileAlreadyOnline], f->name, lib_name(newdir), dir_name(newdir));
return false;
}
......
......@@ -346,8 +346,8 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x0d\x0a\x01\x72\x01\x68\x01\x69\x50\x6c\x65\x61\x73\x65\x20\x75\x70\x6c\x6f\x61\x64\x20\x66\x69\x6c\x65\x73\x20\x77\x69\x74\x68"
"\x20\x74\x68\x65\x20\x66\x6f\x6c\x6c\x6f\x77\x69\x6e\x67\x20\x65\x78\x74\x65\x6e\x73\x69\x6f\x6e\x73\x20\x6f\x6e\x6c\x79\x3a\x01"
"\x6e\x0d\x0a\x01\x77\x01\x68" // 210 TheseFileExtsOnly
,"\x0d\x0a\x01\x72\x01\x68\x01\x69\x25\x73\x20\x68\x61\x73\x20\x61\x6c\x72\x65\x61\x64\x79\x20\x62\x65\x65\x6e\x20\x75\x70\x6c\x6f"
"\x61\x64\x65\x64\x21\x01\x6e\x0d\x0a" // 211 FileAlreadyOnline
,"\x0d\x0a\x01\x6e\x01\x68\x25\x73\x01\x72\x01\x68\x01\x69\x20\x68\x61\x73\x20\x61\x6c\x72\x65\x61\x64\x79\x20\x62\x65\x65\x6e\x20"
"\x75\x70\x6c\x6f\x61\x64\x65\x64\x20\x74\x6f\x01\x6e\x01\x63\x20\x25\x73\x20\x01\x68\x25\x73\x01\x6e\x0d\x0a" // 211 FileAlreadyOnline
,"\x0d\x0a\x01\x77\x01\x68\x48\x69\x74\x20\x5b\x45\x4e\x54\x45\x52\x5d\x20\x61\x66\x74\x65\x72\x20\x6c\x61\x73\x74\x20\x64\x65\x73"
"\x74\x69\x6e\x61\x74\x69\x6f\x6e\x20\x75\x73\x65\x72\x2e\x0d\x0a\x0d\x0a" // 212 EnterAfterLastDestUser
,"\x01\x5f\x01\x79\x01\x68\x53\x65\x6e\x64\x20\x66\x69\x6c\x65\x20\x74\x6f\x20\x28\x55\x73\x65\x72\x20\x6e\x61\x6d\x65\x20\x6f\x72"
......
......@@ -125,7 +125,7 @@ bool sbbs_t::uploadfile(file_t* f)
for(int j=0; j < usrdirs[i]; j++,k++) {
if(cfg.dir[usrdir[i][j]]->misc&DIR_DUPES
&& findfile(&cfg, usrdir[i][j], /* filename: */NULL, f)) {
bprintf(text[FileAlreadyOnline], f->name);
bprintf(text[FileAlreadyOnline], f->name, lib_name(usrdir[i][j]), dir_name(usrdir[i][j]));
if(!dir_op(f->dir)) {
remove(path);
safe_snprintf(str, sizeof(str), "attempted to upload %s to %s %s (duplicate hash)"
......@@ -315,7 +315,7 @@ bool sbbs_t::upload(int dirnum)
bool found = findfile(&cfg, dirnum, fname, NULL);
bputs(text[SearchedForDupes]);
if(found) {
bprintf(text[FileAlreadyOnline],fname);
bprintf(text[FileAlreadyOnline],fname, lib_name(dirnum), dir_name(dirnum));
return(false); /* File is already in database */
}
for(i=k=0;i<usrlibs;i++) {
......@@ -326,7 +326,7 @@ bool sbbs_t::upload(int dirnum)
if(cfg.dir[usrdir[i][j]]->misc&DIR_DUPES
&& findfile(&cfg, usrdir[i][j], fname, NULL)) {
bputs(text[SearchedForDupes]);
bprintf(text[FileAlreadyOnline],fname);
bprintf(text[FileAlreadyOnline], fname, lib_name(usrdir[i][j]), dir_name(usrdir[i][j]));
if(!dir_op(dirnum))
return(false); /* File is in database for another dir */
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment