Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 40ea0e5f authored by rswindell's avatar rswindell

Auto-detect ZMODEM upload of message text in internal line editor.

Discards any previously quoted/typed text, but remains in the editor with the
uploaded text available for append or edit.
parent b6bf6635
......@@ -939,7 +939,32 @@ ulong sbbs_t::msgeditor(char *buf, const char *top, char *title)
strin[0]=0;
if(line < 1)
carriage_return();
ulong prev_con = console;
getstr(strin, cols-1, K_WRAP|K_MSG|K_EDIT|K_LEFTEXIT|K_NOCRLF);
if((prev_con&CON_DELETELINE) /* Ctrl-X/ZDLE */ && strncmp(strin, "B00", 3) == 0) {
strin[0] = 0;
char fname[MAX_PATH + 1];
SAFEPRINTF(fname, "%sUPLOAD.MSG", cfg.temp_dir);
removecase(fname);
if(!recvfile(fname, 'Z', /* autohang: */false)) {
bprintf(text[FileNotReceived], "File");
continue;
}
FILE* fp = fopen(fname, "r");
if(fp == NULL) {
errormsg(WHERE, ERR_OPEN, fname, 0);
continue;
}
strListFreeStrings(str);
strListReadFile(fp, &str, /* max line len */cols - 1);
strListTruncateTrailingLineEndings(str);
char rx_lines[128];
SAFEPRINTF(rx_lines, "%u lines", lines = strListCount(str));
bprintf(text[FileNBytesReceived], rx_lines, ultoac(ftell(fp), tmp));
line = lines;
fclose(fp);
continue;
}
} while(console&CON_UPARROW && !line && online);
if(sys_status&SS_ABORT)
......
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