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

Save/reuse the mail save path/filename as a user property (in data/user/*.ini)

This is a fix for issue #340

Another idea would be to store a history of mail save paths and allow the user
to scroll through them/choose with the up and down arrow keys, but that goes
beyond the original feature request. So this just stores/reuses the last
successfully used path/filename.
parent b39c7c70
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6539 passed
......@@ -44,6 +44,7 @@ int sbbs_t::readmail(uint usernumber, int which, int lm_mode)
char str[256],str2[256],done=0,domsg=1
,*p;
char tmp[512];
char savepath[MAX_PATH + 1]{};
int i;
uint32_t u,v;
int mismatches=0,act;
......@@ -637,8 +638,15 @@ int sbbs_t::readmail(uint usernumber, int which, int lm_mode)
break;
*/
bputs(text[FileToWriteTo]);
if(getstr(str,50,K_LINE))
msgtotxt(&smb, &msg, str, /* header: */true, /* mode: */GETMSGTXT_ALL);
{
const char* section = "mail";
const char* key = "savepath";
user_get_property(&cfg, useron.number, section, key, savepath, sizeof(savepath) - 1);
if(getstr(savepath, sizeof(savepath) - 1, K_EDIT | K_LINE | K_AUTODEL) > 0) {
if(msgtotxt(&smb, &msg, savepath, /* header: */true, /* mode: */GETMSGTXT_ALL))
user_set_property(&cfg, useron.number, section, key, savepath);
}
}
break;
case 'E':
editmsg(&smb, &msg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment