Commit fb7ff33b authored by rswindell's avatar rswindell
Browse files

Address a couple of concerns from Accession:

Don't add TZUTC kludge lines to exported netmail and echomail messages when
there is already a TZUTC FidoNet control line in the message header (unexpected
but apparently, GoldEd+ does this).
If there are other duplicate FTN control/kludge lines created by SBBSecho
exporting messages added to SMBs by GoldEd+, we should address those too, even
though I believe in most cases, you should configure the editor to *not* add
these header fields in the first place.
Do not convert exisiting Origin Line's to effectively comments (replacing *
with # in " * Origin") if the current sub-board has been configured to not add
network tag/origin-lines.
parent 51848214
......@@ -426,6 +426,16 @@ size_t fwrite_crlf(char* buf, size_t len, FILE* fp)
return(wr);
}
BOOL fidoctrl_line_exists(smbmsg_t* msg, const char* prefix)
{
for(int i=0; i<msg->total_hfields; i++) {
if(msg->hfield[i].type == FIDOCTRL
&& strncmp((char*)msg->hfield_dat[i], prefix, strlen(prefix)) == 0)
return TRUE;
}
return FALSE;
}
/******************************************************************************
This function will create a netmail message (.MSG format).
If file is non-zero, will set file attachment bit (for bundles).
......@@ -518,15 +528,16 @@ int create_netmail(char *to, smbmsg_t* msg, char *subject, char *body, faddr_t d
,hdr.destzone,hdr.destnet,hdr.destnode
,hdr.origzone,hdr.orignet,hdr.orignode);
/* TZUTC (FSP-1001) */
int tzone=smb_tzutc(when_written.zone);
char* minus="";
if(tzone<0) {
minus="-";
tzone=-tzone;
if(!fidoctrl_line_exists(msg, "TZUTC:")) {
/* TZUTC (FSP-1001) */
int tzone=smb_tzutc(when_written.zone);
char* minus="";
if(tzone<0) {
minus="-";
tzone=-tzone;
}
fprintf(fp,"\1TZUTC: %s%02d%02u\r", minus, tzone/60, tzone%60);
}
fprintf(fp,"\1TZUTC: %s%02d%02u\r", minus, tzone/60, tzone%60);
/* Add FSC-53 FLAGS kludge */
fprintf(fp,"\1FLAGS");
if(attr&ATTR_DIRECT)
......@@ -3935,15 +3946,16 @@ void export_echomail(char *sub_code,faddr_t addr)
tear=0;
f=0;
tzone=smb_tzutc(msg.hdr.when_written.zone);
if(tzone<0) {
minus="-";
tzone=-tzone;
} else
minus="";
f+=sprintf(fmsgbuf+f,"\1TZUTC: %s%02d%02u\r" /* TZUTC (FSP-1001) */
,minus,tzone/60,tzone%60);
if(!fidoctrl_line_exists(&msg, "TZUTC:")) {
tzone=smb_tzutc(msg.hdr.when_written.zone);
if(tzone<0) {
minus="-";
tzone=-tzone;
} else
minus="";
f+=sprintf(fmsgbuf+f,"\1TZUTC: %s%02d%02u\r" /* TZUTC (FSP-1001) */
,minus,tzone/60,tzone%60);
}
if(msg.ftn_flags!=NULL)
f+=sprintf(fmsgbuf+f,"\1FLAGS %.256s\r", msg.ftn_flags);
......@@ -4005,7 +4017,7 @@ void export_echomail(char *sub_code,faddr_t addr)
else
tear=1;
}
else if(!strncmp(tp," * Origin: ",11))
else if(!(scfg.sub[i]->misc&SUB_NOTAG) && !strncmp(tp," * Origin: ",11))
*(tp+1)='#';
} /* Convert * Origin into # Origin */
......
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