Commit 7fd4beb5 authored by rswindell's avatar rswindell
Browse files

Display the message header's "To-Extension" value (usually the user number)

*after* the to-net-addr value (if there is one), so the header display makes
more logical sense when viewing QWK netmail sent to a QWKnet node on the
QWKnet hub system.
Update the msgtotxt() prototype to follow the norm (e.g. passing through the
mode argument to smb_getmsgtxt())
parent c183c3c4
......@@ -192,7 +192,7 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
/****************************************************************************/
/* Writes message header and text data to a text file */
/****************************************************************************/
void sbbs_t::msgtotxt(smbmsg_t* msg, char *str, int header, int tails)
void sbbs_t::msgtotxt(smbmsg_t* msg, char *str, bool header, ulong mode)
{
char *buf;
char tmp[128];
......@@ -207,10 +207,10 @@ void sbbs_t::msgtotxt(smbmsg_t* msg, char *str, int header, int tails)
fprintf(out,"\r\n");
fprintf(out,"Subj : %s\r\n",msg->subj);
fprintf(out,"To : %s",msg->to);
if(msg->to_ext)
fprintf(out," #%s",msg->to_ext);
if(msg->to_net.addr)
fprintf(out," (%s)",smb_netaddrstr(&msg->to_net,tmp));
if(msg->to_ext)
fprintf(out," #%s",msg->to_ext);
fprintf(out,"\r\nFrom : %s",msg->from);
if(msg->from_ext && !(msg->hdr.attr&MSG_ANONYMOUS))
fprintf(out," #%s",msg->from_ext);
......@@ -222,7 +222,7 @@ void sbbs_t::msgtotxt(smbmsg_t* msg, char *str, int header, int tails)
fprintf(out,"\r\n\r\n");
}
buf=smb_getmsgtxt(&smb,msg,tails);
buf=smb_getmsgtxt(&smb,msg,mode);
if(buf!=NULL) {
strip_invalid_attr(buf);
fputs(buf,out);
......
......@@ -696,8 +696,8 @@ void sbbs_t::readmail(uint usernumber, int which)
break;
*/
bputs(text[FileToWriteTo]);
if(getstr(str,40,K_LINE))
msgtotxt(&msg,str,1,1);
if(getstr(str,50,K_LINE))
msgtotxt(&msg,str, /* header: */true, /* mode: */GETMSGTXT_ALL);
break;
case 'E':
editmsg(&msg,INVALID_SUB);
......
......@@ -1070,8 +1070,8 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
break;
*/
bputs(text[FileToWriteTo]);
if(getstr(str,40,K_LINE))
msgtotxt(&msg,str,1,1);
if(getstr(str,50,K_LINE))
msgtotxt(&msg,str, /* header: */true, /* mode: */GETMSGTXT_ALL);
break;
case 'U': /* User edit */
useredit(cfg.sub[subnum]->misc&SUB_NAME
......
......@@ -645,7 +645,7 @@ public:
void show_msgattr(ushort attr);
void show_msghdr(smbmsg_t* msg);
void show_msg(smbmsg_t* msg, long mode);
void msgtotxt(smbmsg_t* msg, char *str, int header, int tails);
void msgtotxt(smbmsg_t* msg, char *str, bool header, ulong mode);
ulong getlastmsg(uint subnum, uint32_t *ptr, time_t *t);
time_t getmsgtime(uint subnum, ulong ptr);
ulong getmsgnum(uint subnum, time_t t);
......
......@@ -1336,7 +1336,7 @@ void sbbs_t::editmsg(smbmsg_t *msg, uint subnum)
msg_tmp_fname(useron.xedit, msgtmp, sizeof(msgtmp));
removecase(msgtmp);
msgtotxt(msg,msgtmp,0,1);
msgtotxt(msg,msgtmp, /* header: */false, /* mode: */GETMSGTXT_ALL);
if(!editfile(msgtmp, /* msg: */true))
return;
length=(long)flength(msgtmp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment