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

Add new P-mode flag: P_NOXATTRS to disable "Extra Attribute Code"

support in putmsg/printfile, etc. on per-use basis.
Add per-sub-board P-mode flags (so "Extra Attribute Codes" can be disabled
on a per-sub-board basis).
parent 268cdc6a
......@@ -292,6 +292,8 @@ bool sbbs_t::show_msg(smb_t* smb, smbmsg_t* msg, long p_mode, post_t* post)
utf8_normalize_str(txt);
p_mode |= P_UTF8;
}
if(smb->subnum < cfg.total_subs)
p_mode |= cfg.sub[smb->subnum]->pmode;
putmsg(p, p_mode, msg->columns);
smb_freemsgtxt(txt);
if(column)
......
......@@ -148,7 +148,8 @@ char sbbs_t::putmsg(const char *buf, long mode, long org_cols)
outchar(ESC); /* Convert `[ and [ to ESC[ */
l++;
}
else if(cfg.sys_misc&SM_PCBOARD && str[l]=='@' && str[l+1]=='X'
else if(!(mode&P_NOXATTRS)
&& (cfg.sys_misc&SM_PCBOARD) && str[l]=='@' && str[l+1]=='X'
&& isxdigit((unsigned char)str[l+2]) && isxdigit((unsigned char)str[l+3])) {
sprintf(tmp2,"%.2s",str+l+2);
ulong val = ahtoul(tmp2);
......@@ -168,14 +169,16 @@ char sbbs_t::putmsg(const char *buf, long mode, long org_cols)
exatr=1;
l+=4;
}
else if(cfg.sys_misc&SM_WILDCAT && str[l]=='@' && str[l+3]=='@'
else if(!(mode&P_NOXATTRS)
&& (cfg.sys_misc&SM_WILDCAT) && str[l]=='@' && str[l+3]=='@'
&& isxdigit((unsigned char)str[l+1]) && isxdigit((unsigned char)str[l+2])) {
sprintf(tmp2,"%.2s",str+l+1);
attr(ahtoul(tmp2));
// exatr=1;
l+=4;
}
else if(cfg.sys_misc&SM_RENEGADE && str[l]=='|' && isdigit((unsigned char)str[l+1])
else if(!(mode&P_NOXATTRS)
&& (cfg.sys_misc&SM_RENEGADE) && str[l]=='|' && isdigit((unsigned char)str[l+1])
&& isdigit((unsigned char)str[l+2]) && !(useron.misc&RIP)) {
sprintf(tmp2,"%.2s",str+l+1);
i=atoi(tmp2);
......@@ -190,7 +193,8 @@ char sbbs_t::putmsg(const char *buf, long mode, long org_cols)
exatr=1;
l+=3; /* Skip |xx */
}
else if(cfg.sys_misc&SM_CELERITY && str[l]=='|' && isalpha((unsigned char)str[l+1])
else if(!(mode&P_NOXATTRS)
&& (cfg.sys_misc&SM_CELERITY) && str[l]=='|' && isalpha((unsigned char)str[l+1])
&& !(useron.misc&RIP)) {
switch(str[l+1]) {
case 'k':
......@@ -248,7 +252,8 @@ char sbbs_t::putmsg(const char *buf, long mode, long org_cols)
exatr=1;
l+=2; /* Skip |x */
} /* Skip second digit if it exists */
else if(cfg.sys_misc&SM_WWIV && str[l]==CTRL_C && isdigit((unsigned char)str[l+1])) {
else if(!(mode&P_NOXATTRS)
&& (cfg.sys_misc&SM_WWIV) && str[l]==CTRL_C && isdigit((unsigned char)str[l+1])) {
exatr=1;
switch(str[l+1]) {
default:
......
......@@ -761,6 +761,7 @@ typedef enum { /* Values for xtrn_t.event */
#define P_WRAP (1<<12) /* Wrap/split long-lines, ungracefully */
#define P_UTF8 (1<<13) /* Message is UTF-8 */
#define P_AUTO_UTF8 (1<<14) /* Message may be UTF-8, auto-detect */
#define P_NOXATTRS (1<<15) /* No "Extra Attribute Codes" supported */
/* Bits in 'mode' for listfiles */
#define FL_ULTIME (1<<0) /* List files by upload time */
......
......@@ -557,6 +557,8 @@ void sub_cfg(uint grpnum)
#endif
sprintf(opt[n++],"%-27.27s%s","Compress Messages (LZH)"
,cfg.sub[i]->misc&SUB_LZH ? "Yes" : "No");
sprintf(opt[n++],"%-27.27s%s","Extra Attribute Codes"
,cfg.sub[i]->pmode&P_NOXATTRS ? "No" : "Yes");
sprintf(opt[n++],"%-27.27s%s","Template for New Subs"
,cfg.sub[i]->misc&SUB_TEMPLATE ? "Yes" : "No");
......@@ -1029,6 +1031,28 @@ void sub_cfg(uint grpnum)
}
break;
case 15:
n=(cfg.sub[i]->pmode&P_NOXATTRS) ? 1:0;
uifc.helpbuf=
"`Extra Attribute Codes:`\n"
"\n"
"Set this option to `No` to disable the interpretation of so-called\n"
"Extra Attribute Codes (printable color codes for other BBS software\n"
"e.g. pipe codes).\n"
;
n=uifc.list(WIN_SAV|WIN_MID,0,0,0,&n,0
,"Interpret/Display Extra Attribute Codes in Messages",uifcYesNoOpts);
if(n==-1)
break;
if(n == 0 && (cfg.sub[i]->pmode&P_NOXATTRS)) {
uifc.changes = TRUE;
cfg.sub[i]->pmode ^= P_NOXATTRS;
}
else if(n == 1 && !(cfg.sub[i]->pmode&P_NOXATTRS)) {
uifc.changes = TRUE;
cfg.sub[i]->pmode ^= P_NOXATTRS;
}
break;
case 16:
n=(cfg.sub[i]->misc&SUB_TEMPLATE) ? 0:1;
uifc.helpbuf=
"`Use this Sub-board as a Template for New Subs:`\n"
......
......@@ -68,6 +68,7 @@ typedef struct { /* Message sub board info */
uint32_t misc, /* Miscellaneous flags */
maxmsgs, /* Max number of messages allowed */
maxcrcs; /* Max number of CRCs to keep */
int32_t pmode; /* printfile()/putmsg() mode flags */
faddr_t faddr; /* FidoNet address */
} sub_t;
......
......@@ -563,8 +563,9 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error)
cfg->sub[i]->mod_ar=ARSTR(cfg->sub[i]->mod_arstr,cfg);
get_int(cfg->sub[i]->qwkconf,instream);
get_int(c,instream);
for(j=0;j<26;j++)
get_int(c,instream); // unused
get_int(cfg->sub[i]->pmode,instream);
for(j=0;j<24;j++)
get_int(n,instream);
}
cfg->total_subs=i;
......
......@@ -444,9 +444,10 @@ BOOL DLLCALL write_msgs_cfg(scfg_t* cfg, int backup_level)
put_str(cfg->sub[i]->mod_arstr,stream);
put_int(cfg->sub[i]->qwkconf,stream);
c=0;
put_int(c,stream);
put_int(c,stream); // unused
put_int(cfg->sub[i]->pmode,stream);
n=0;
for(k=0;k<26;k++)
for(k=0;k<24;k++)
put_int(n,stream);
if(all_msghdr || (cfg->sub[i]->misc&SUB_HDRMOD && !no_msghdr)) {
......
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