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

When editing a message, pass the proper to/from/subj/area to drop file

Fixes issue #704 - not just for JS bbs.edit_msg(), but for all uses of the underlying sbbs_t::editmsg() function.

Replaced one specific comparison of subnum == INVALID_SUB with call to is_valid_subnum() just to be consistent. No functional change there.
parent 0503c290
No related branches found
No related tags found
No related merge requests found
Pipeline #5409 passed
...@@ -589,7 +589,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode, ...@@ -589,7 +589,7 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, int mode,
} }
} }
} }
editor_inf(useron_xedit,to,from,subj,mode,subnum==INVALID_SUB ? nulstr : cfg.sub[subnum]->sname, tagfile); editor_inf(useron_xedit,to,from,subj,mode, is_valid_subnum(subnum) ? cfg.sub[subnum]->sname : nulstr, tagfile);
if(cfg.xedit[useron_xedit-1]->type) { if(cfg.xedit[useron_xedit-1]->type) {
gettimeleft(); gettimeleft();
xtrndat(mode&WM_ANON ? text[Anonymous]:from,cfg.node_dir,cfg.xedit[useron_xedit-1]->type xtrndat(mode&WM_ANON ? text[Anonymous]:from,cfg.node_dir,cfg.xedit[useron_xedit-1]->type
...@@ -1664,7 +1664,7 @@ bool sbbs_t::editmsg(smb_t* smb, smbmsg_t *msg) ...@@ -1664,7 +1664,7 @@ bool sbbs_t::editmsg(smb_t* smb, smbmsg_t *msg)
msg_tmp_fname(useron.xedit, msgtmp, sizeof(msgtmp)); msg_tmp_fname(useron.xedit, msgtmp, sizeof(msgtmp));
(void)removecase(msgtmp); (void)removecase(msgtmp);
msgtotxt(smb, msg, msgtmp, /* header: */false, /* mode: */is_msg ? GETMSGTXT_ALL : GETMSGTXT_BODY_ONLY); msgtotxt(smb, msg, msgtmp, /* header: */false, /* mode: */is_msg ? GETMSGTXT_ALL : GETMSGTXT_BODY_ONLY);
if(!editfile(msgtmp, cfg.level_linespermsg[useron.level])) if(!editfile(msgtmp, cfg.level_linespermsg[useron.level], msg->to, msg->from, msg->subj, is_valid_subnum(smb->subnum) ? cfg.sub[smb->subnum]->sname : nulstr))
return false; return false;
length=(long)flength(msgtmp); length=(long)flength(msgtmp);
if(length<1L) if(length<1L)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment