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

Use smb_open_sub() for the "mail" base too

This restores the ability for JS MsgBase() to be used to create the
initial mail message base properly, if needed.

This means that the 'subnum' should now be equal to scfg.total_subs
when referencing an arbitrary SMB via path (not in the configuration).
parent 1e62752a
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -85,7 +85,7 @@ js_open(JSContext *cx, uintN argc, jsval *arglist) ...@@ -85,7 +85,7 @@ js_open(JSContext *cx, uintN argc, jsval *arglist)
JS_SET_RVAL(cx, arglist, JSVAL_FALSE); JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
if(p->smb.subnum==INVALID_SUB if(p->smb.subnum >= scfg->total_subs
&& strchr(p->smb.file,'/')==NULL && strchr(p->smb.file,'/')==NULL
&& strchr(p->smb.file,'\\')==NULL) { && strchr(p->smb.file,'\\')==NULL) {
JS_ReportError(cx,"Unrecognized msgbase code: %s",p->smb.file); JS_ReportError(cx,"Unrecognized msgbase code: %s",p->smb.file);
...@@ -93,7 +93,7 @@ js_open(JSContext *cx, uintN argc, jsval *arglist) ...@@ -93,7 +93,7 @@ js_open(JSContext *cx, uintN argc, jsval *arglist)
} }
rc=JS_SUSPENDREQUEST(cx); rc=JS_SUSPENDREQUEST(cx);
if(p->smb.subnum == INVALID_SUB) if(p->smb.subnum >= scfg->total_subs && p->smb.subnum != INVALID_SUB)
p->smb_result = smb_open(&(p->smb)); p->smb_result = smb_open(&(p->smb));
else else
p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum); p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum);
...@@ -3422,7 +3422,6 @@ js_msgbase_constructor(JSContext *cx, uintN argc, jsval *arglist) ...@@ -3422,7 +3422,6 @@ js_msgbase_constructor(JSContext *cx, uintN argc, jsval *arglist)
,scfg->sub[p->smb.subnum]->data_dir,scfg->sub[p->smb.subnum]->code); ,scfg->sub[p->smb.subnum]->data_dir,scfg->sub[p->smb.subnum]->code);
} else { /* unknown code */ } else { /* unknown code */
SAFECOPY(p->smb.file,base); SAFECOPY(p->smb.file,base);
p->smb.subnum=INVALID_SUB;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment