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

Define and use a new external message editor option: SAVECOLUMNS

(default: off) - when enabled, the current terminal width (columns) will be
saved in the msg header.
When using the internal msg editor or raw intput mode, the columns are always
saved in the message editor. fseditor.js should have this option enabled.
parent 99494140
......@@ -111,9 +111,7 @@ bool sbbs_t::bulkmail(uchar *ar)
msg.hdr.when_written.time=time32(NULL);
msg.hdr.when_written.zone=sys_timezone(&cfg);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
memset(&smb,0,sizeof(smb));
smb.subnum=INVALID_SUB; /* mail database */
......
......@@ -317,9 +317,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode,
add_msg_ids(&cfg, &smb, &msg, remsg);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
smb_dfield(&msg,TEXT_BODY,length);
......
......@@ -350,9 +350,7 @@ bool sbbs_t::netmail(const char *into, const char *title, long mode, smb_t* resm
smb_hfield_str(&msg,SUBJECT, subj);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
if(cfg.netmail_misc&NMAIL_DIRECT)
msg.hdr.netattr |= MSG_DIRECT;
......
......@@ -279,9 +279,7 @@ bool sbbs_t::inetmail(const char *into, const char *subj, long mode, smb_t* resm
add_msg_ids(&cfg, &smb, &msg, remsg);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
smb_dfield(&msg,TEXT_BODY,length);
......@@ -493,9 +491,7 @@ bool sbbs_t::qnetmail(const char *into, const char *subj, long mode, smb_t* resm
add_msg_ids(&cfg, &smb, &msg, /* remsg: */NULL);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
smb_dfield(&msg,TEXT_BODY,length);
......
......@@ -290,9 +290,7 @@ bool sbbs_t::postmsg(uint subnum, long wm_mode, smb_t* resmb, smbmsg_t* remsg)
add_msg_ids(&cfg, &smb, &msg, remsg);
if(editor!=NULL)
smb_hfield_str(&msg,SMB_EDITOR,editor);
smb_hfield_bin(&msg, SMB_COLUMNS, cols);
editor_info_to_msg(&msg, editor);
if((cfg.sub[subnum]->misc&SUB_MSGTAGS)
&& (tags[0] || text[TagMessageQ][0] == 0 || !noyes(text[TagMessageQ]))) {
......
......@@ -668,6 +668,7 @@ public:
bool movemsg(smbmsg_t* msg, uint subnum);
int process_edited_text(char* buf, FILE* stream, long mode, unsigned* lines, unsigned maxlines);
int process_edited_file(const char* src, const char* dest, long mode, unsigned* lines, unsigned maxlines);
void editor_info_to_msg(smbmsg_t*, const char* editor);
/* postmsg.cpp */
bool postmsg(uint subnum, long wm_mode = WM_NONE, smb_t* resmb = NULL, smbmsg_t* remsg = NULL);
......
......@@ -410,6 +410,7 @@ typedef enum { /* Values for xtrn_t.event */
#define XTRN_PAUSE (1<<19) /* Force a screen pause on exit */
#define XTRN_NOECHO (1<<20) /* Don't echo stdin to stdout */
#define QUOTEWRAP (1<<21) /* Word-wrap quoted message text */
#define SAVECOLUMNS (1<<22) /* Save/share current terminal width */
#define XTRN_CONIO (1<<31) /* Intercept Windows Console I/O (Drwy) */
/* Bits in cfg.xtrn_misc */
......
......@@ -657,6 +657,20 @@ bool sbbs_t::writemsg(const char *fname, const char *top, char *subj, long mode,
return(true);
}
void sbbs_t::editor_info_to_msg(smbmsg_t* msg, const char* editor)
{
if(editor != NULL)
smb_hfield_str(msg, SMB_EDITOR, editor);
ushort useron_xedit = useron.xedit;
if(useron_xedit > 0 && !chk_ar(cfg.xedit[useron_xedit - 1]->ar, &useron, &client))
useron_xedit = 0;
if(editor == NULL || useron_xedit == 0 || (cfg.xedit[useron_xedit - 1]->misc&SAVECOLUMNS))
smb_hfield_bin(msg, SMB_COLUMNS, cols);
}
/****************************************************************************/
/****************************************************************************/
/* Modify 'str' to for quoted format. Remove ^A codes, etc. */
......
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