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

When writing/reading quotes.txt, ignore first 2 lines if WWIV-type

WWIV writes 2 lines of metadata to the beginning of its quotes.txt file created for external message editors. Its not clear yet what these lines should contain, but the first line apparently should contain a '#' character since BREdit checks for this character before deciding to throw-away/ignore these lines (don't use them for quoted text). Thanks mlong for this tip!

So if the external editor is set to "WWIV CHAIN.TXT" in SCFG (even if the door doesn't need/use it), then the quotes.txt file created by Synchronet will contain the extra 2 lines. We're just writing a # to the first line and the second line is blank.

This fixes reported issue #188.
parent 381c8037
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2405 passed
......@@ -85,6 +85,9 @@ bool sbbs_t::quotemsg(smb_t* smb, smbmsg_t* msg, bool tails)
return false;
}
if(useron_xedit > 0 && cfg.xedit[useron_xedit - 1]->type == XTRN_WWIV)
fputs("#\r\n\r\n", fp); // WWIV adds 2 lines of metadata, BRedit checks for the # symbol
bool result = false;
ulong mode = GETMSGTXT_PLAIN;
if(tails) mode |= GETMSGTXT_TAILS;
......@@ -329,6 +332,10 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
free(buf);
return(false);
}
if(cfg.xedit[useron_xedit - 1]->type == XTRN_WWIV) { // 2 lines of metadata
fgets(str, sizeof(str), stream);
fgets(str, sizeof(str), stream);
}
if((file=nopen(msgtmp,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
errormsg(WHERE,ERR_OPEN,msgtmp,O_WRONLY|O_CREAT|O_TRUNC);
free(buf);
......@@ -361,6 +368,11 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
return(false);
}
if(useron_xedit > 0 && cfg.xedit[useron_xedit - 1]->type == XTRN_WWIV) { // 2 lines of metadata
fgets(str, sizeof(str), stream);
fgets(str, sizeof(str), stream);
}
if((file=nopen(msgtmp,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
errormsg(WHERE,ERR_OPEN,msgtmp,O_WRONLY|O_CREAT|O_TRUNC);
free(buf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment