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 127e0b6e authored by rswindell's avatar rswindell

Add a new quotewrap_cols setting for external editors, default is 0 (current

terminal width) - only used when the QUOTEWRAP option is set. Common values:
0 - current behavior, wrap the quote file to the current terminal width
80 - wrap 80 columns specifically (actually, 79)
9999 - unwrap to long lines (one line per paragraph)

Actually, previously it was wrapping to current terminal width minus 4 when
QUOTEWRAP was enabled. Now, make that current terminal width minus 1
(when quotewrap_cols is set to 0).
parent 525b7b76
......@@ -288,6 +288,7 @@ typedef struct { /* External Editors */
uchar *ar;
uint32_t misc; /* Misc. bits */
uchar type; /* Drop file type */
uint16_t quotewrap_cols; /* When word-wrapping quoted text, use this width (if non-zero */
} xedit_t;
......
......@@ -495,7 +495,8 @@ BOOL read_xtrn_cfg(scfg_t* cfg, char* error)
get_int(cfg->xedit[i]->type,instream);
get_int(c,instream);
for(j=0;j<7;j++)
get_int(cfg->xedit[i]->quotewrap_cols, instream);
for(j=0;j<6;j++)
get_int(n,instream);
}
cfg->total_xedits=i;
......
......@@ -1008,7 +1008,8 @@ BOOL DLLCALL write_xtrn_cfg(scfg_t* cfg, int backup_level)
c=0;
put_int(c,stream);
n=0;
for(j=0;j<7;j++)
put_int(cfg->xedit[i]->quotewrap_cols, stream);
for(j=0;j<6;j++)
put_int(n,stream);
}
......
......@@ -103,8 +103,12 @@ bool sbbs_t::quotemsg(smb_t* smb, smbmsg_t* msg, bool tails)
if((buf=smb_getmsgtxt(smb, msg, mode)) != NULL) {
strip_invalid_attr(buf);
truncsp(buf);
if(!useron_xedit || (useron_xedit && (cfg.xedit[useron_xedit-1]->misc&QUOTEWRAP)))
wrapped=::wordwrap(buf, cols-4, org_cols - 1, /* handle_quotes: */TRUE);
if(!useron_xedit || (useron_xedit && (cfg.xedit[useron_xedit-1]->misc&QUOTEWRAP))) {
int wrap_cols = cfg.xedit[useron_xedit-1]->quotewrap_cols;
if(wrap_cols == 0)
wrap_cols = cols - 1;
wrapped=::wordwrap(buf, wrap_cols, org_cols - 1, /* handle_quotes: */TRUE);
}
if(wrapped!=NULL) {
fputs(wrapped,fp);
free(wrapped);
......
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