Commit 40b2188a authored by rswindell's avatar rswindell
Browse files

New QWKnet hub configuration settings (with defaults):

- Include Kludge Lines     (Yes)
- Include VOTING.DAT File   (Yes)
- Include HEADERS.DAT File   (Yes)
- Extended (QWKE) Packets    (No)
- Exported Ctrl-A Codes    (Strip)

SBBS/QWKnet nodes now have more control over the REP packet files created
by their systems. If the "uplink" (hub) is complaining about receiving
unsupported files (e.g. VOTING.DAT) or kluge lines (e.g. @TZ), just turn them
off.

Also, Ctrl-A codes may now be retained in QWKnetmail. And the @REPLYTO kludge
line enabled for the first time (!).
parent 16a421b9
......@@ -384,7 +384,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, uint subnum
size++;
continue;
}
if(mode&A_EXPAND) {
if(mode&QM_EXPCTLA) {
str[0]=0;
switch(toupper(ch)) {
case 'W':
......@@ -451,7 +451,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, uint subnum
size+=fwrite(str,sizeof(char),strlen(str),qwk_fp);
continue;
} /* End Expand */
if(mode&A_LEAVE && valid_ctrl_a_code(ch)) {
if(mode&QM_RETCTLA && valid_ctrl_a_code(ch)) {
fputc(CTRL_A,qwk_fp);
fputc(ch,qwk_fp);
size+=2L;
......@@ -478,7 +478,7 @@ ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, uint subnum
safe_snprintf(tmp,sizeof(tmp)," %c \1g%.10s\1n %c %.127s%c"
,ch,VERSION_NOTICE,ch,cfg.sub[subnum]->tagline,QWK_NEWLINE);
strcat(str,tmp);
if(!(mode&A_LEAVE))
if(!(mode&QM_RETCTLA))
remove_ctrl_a(str,str);
size+=fwrite(str,sizeof(char),strlen(str),qwk_fp);
}
......
......@@ -94,13 +94,13 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
errormsg(WHERE,ERR_EXEC,p,i);
}
if(useron.rest&FLAG('Q') && useron.qwk&QWK_RETCTLA)
useron.qwk|=(QWK_NOINDEX|QWK_NOCTRL|QWK_VIA|QWK_TZ|QWK_MSGID);
if(useron.rest&FLAG('Q'))
useron.qwk|=QWK_NOINDEX|QWK_NOCTRL;
if(useron.qwk&QWK_EXPCTLA)
mode=A_EXPAND;
mode=QM_EXPCTLA;
else if(useron.qwk&QWK_RETCTLA)
mode=A_LEAVE;
mode=QM_RETCTLA;
else mode=0;
if(useron.qwk&QWK_TZ)
mode|=QM_TZ;
......@@ -405,7 +405,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
mv(str,tmp,/* copy: */TRUE);
}
size=msgtoqwk(&msg,qwk,mode,INVALID_SUB,0,hdrs);
size=msgtoqwk(&msg,qwk,mode|QM_REPLYTO,INVALID_SUB,0,hdrs);
smb_unlockmsghdr(&smb,&msg);
smb_freemsgmem(&msg);
if(ndx && size) {
......
......@@ -93,17 +93,18 @@ bool sbbs_t::pack_rep(uint hubnum)
}
fseek(rep,0L,SEEK_END);
/* Always includes HEADERS.DAT in .REP packets which are only for QWKnet hubs */
/* And *usually* a Synchronet system */
SAFEPRINTF(str,"%sHEADERS.DAT",cfg.temp_dir);
fexistcase(str);
if((hdrs=fopen(str,"a"))==NULL)
errormsg(WHERE,ERR_CREATE,str,0);
SAFEPRINTF(str,"%sVOTING.DAT",cfg.temp_dir);
fexistcase(str);
if((voting=fopen(str,"a"))==NULL)
errormsg(WHERE,ERR_CREATE,str,0);
if(!(cfg.qhub[hubnum]->misc&QHUB_NOHEADERS)) {
SAFEPRINTF(str,"%sHEADERS.DAT",cfg.temp_dir);
fexistcase(str);
if((hdrs=fopen(str,"a"))==NULL)
errormsg(WHERE,ERR_CREATE,str,0);
}
if(!(cfg.qhub[hubnum]->misc&QHUB_NOVOTING)) {
SAFEPRINTF(str,"%sVOTING.DAT",cfg.temp_dir);
fexistcase(str);
if((voting=fopen(str,"a"))==NULL)
errormsg(WHERE,ERR_CREATE,str,0);
}
/*********************/
/* Pack new messages */
/*********************/
......@@ -147,7 +148,11 @@ bool sbbs_t::pack_rep(uint hubnum)
continue;
}
msgtoqwk(&msg,rep,QM_TO_QNET|QM_REP|A_LEAVE,INVALID_SUB,0,hdrs);
mode = QM_TO_QNET|QM_REP;
mode |= (cfg.qhub[hubnum]->misc&(QHUB_EXT|QHUB_CTRL_A));
/* For an unclear reason, kludge lines (including @VIA and @TZ) were not included in NetMail previously */
if(!(cfg.qhub[hubnum]->misc&QHUB_NOHEADERS)) mode|=(QM_VIA|QM_TZ|QM_MSGID|QM_REPLYTO);
msgtoqwk(&msg, rep, mode, INVALID_SUB, 0, hdrs);
packedmail++;
smb_unlockmsghdr(&smb,&msg);
smb_freemsgmem(&msg);
......@@ -217,8 +222,9 @@ bool sbbs_t::pack_rep(uint hubnum)
continue;
}
mode=cfg.qhub[hubnum]->mode[i]|QM_TO_QNET|QM_REP;
if(mode&A_LEAVE) mode|=(QM_VIA|QM_TZ|QM_MSGID);
mode = cfg.qhub[hubnum]->mode[i]|QM_TO_QNET|QM_REP;
mode |= (cfg.qhub[hubnum]->misc&(QHUB_EXT|QHUB_CTRL_A));
if(!(cfg.qhub[hubnum]->misc&QHUB_NOHEADERS)) mode|=(QM_VIA|QM_TZ|QM_MSGID|QM_REPLYTO);
if(msg.from_net.type!=NET_QWK)
mode|=QM_TAGLINE;
......
......@@ -38,6 +38,10 @@
#define QWK_HFIELD_LEN 25 /* Header field (To/From/Subject) length */
/* QWK mode bits for qwktomsg() and msgtoqwk() */
#define QM_EXPCTLA (1<<0) /* Expand Ctrl-A codes to ANSI */
#define QM_RETCTLA (1<<1) /* Retain Ctrl-A codes */
#define QM_CTRL_A (QM_EXPCTLA|QM_RETCTLA)
#define QM_STRIP 0 /* Strip Ctrl-A codes */
#define QM_TAGLINE (1<<5) /* Place tagline at end of QWK message */
#define QM_TO_QNET (1<<6) /* Sending to QWKnet hub */
#define QM_REP (1<<7) /* It's a REP packet */
......@@ -45,7 +49,7 @@
#define QM_TZ (1<<9) /* Include @TZ kludge */
#define QM_MSGID (1<<10) /* Include @MSGID and @REPLY kludges */
#define QM_REPLYTO (1<<11) /* Include @REPLYTO kludge */
#define QM_EXT (1<<12) /* QWK Extended (QWKE) mode */
#define QM_EXT (1<<13) /* QWK Extended (QWKE) mode (same as QWK_EXT and QHUB_EXT) */
float ltomsbin(long val);
bool route_circ(char *via, char *id);
......
......@@ -370,12 +370,7 @@ typedef enum { /* Values for xtrn_t.event */
#define EVENT_FORCE (1<<1) /* Force users off-line for event */
#define EVENT_INIT (1<<2) /* Always run event after init */
#define EVENT_DISABLED (1<<3) /* Disabled */
/* Mode bits for QWK stuff */
#define A_EXPAND (1<<0) /* Expand to ANSI sequences */
#define A_LEAVE (1<<1) /* Leave in */
#define A_STRIP (1<<2) /* Strip out */
/* Bits in xtrn_t.misc */
#define MULTIUSER (1<<0) /* allow multi simultaneous users */
#define XTRN_ANSI (1<<1) /* LEGACY (not used) */
......@@ -430,6 +425,15 @@ typedef enum { /* Values for xtrn_t.event */
#define QWK_VOTING (1L<<17) /* Include VOTING.DAT */
#define QWK_DEFAULT (QWK_FILES|QWK_ATTACH|QWK_EMAIL|QWK_DELMAIL)
#define QHUB_EXPCTLA (1<<0) /* Same as QM_EXPCTLA */
#define QHUB_RETCTLA (1<<1) /* Same as QM_RETCTLA */
#define QHUB_CTRL_A (QHUB_EXPCTLA|QHUB_RETCTLA)
#define QHUB_STRIP 0
#define QHUB_EXT (1<<13) /* Use QWKE format */
#define QHUB_NOKLUDGES (1<<14) /* Don't include @-kludges */
#define QHUB_NOHEADERS (1<<16) /* Don't include HEADERS.DAT */
#define QHUB_NOVOTING (1<<17) /* Don't include VOTING.DAT */
/* Bits in user.chat */
#define CHAT_ECHO (1<<0) /* Multinode chat echo */
......
/* scfgnet.c */
/* $Id$ */
/****************************************************************************
......@@ -908,14 +906,48 @@ while(!done) {
sprintf(str,"%2.2u:%2.2u",cfg.qhub[num]->time/60,cfg.qhub[num]->time%60);
sprintf(opt[i++],"%-27.27s%s","Call-out Time",str);
}
sprintf(opt[i++],"%-27.27s%s","Include Kludge Lines", cfg.qhub[num]->misc&QHUB_NOKLUDGES ? "No":"Yes");
sprintf(opt[i++],"%-27.27s%s","Include VOTING.DAT File", cfg.qhub[num]->misc&QHUB_NOVOTING ? "No":"Yes");
sprintf(opt[i++],"%-27.27s%s","Include HEADERS.DAT File", cfg.qhub[num]->misc&QHUB_NOHEADERS ? "No":"Yes");
sprintf(opt[i++],"%-27.27s%s","Extended (QWKE) Packets", cfg.qhub[num]->misc&QHUB_EXT ? "Yes":"No");
sprintf(opt[i++],"%-27.27s%s","Exported Ctrl-A Codes"
,cfg.qhub[num]->misc&QHUB_EXPCTLA ? "Expand" : cfg.qhub[num]->misc&QHUB_RETCTLA ? "Leave in" : "Strip");
strcpy(opt[i++],"Networked Sub-boards...");
opt[i][0]=0;
sprintf(str,"%s Network Hub",cfg.qhub[num]->id);
uifc.helpbuf=
"`QWK Network Hub Configuration:`\n"
"\n"
"This menu allows you to configure options specific to this QWK network\n"
"hub.\n"
"This menu allows you to configure options specific to this QWKnet hub.\n"
"\n"
"The `Hub System ID` must match the QWK System ID of this network hub.\n"
"\n"
"The `Pack` and `Unpack Command Lines` are used for creating and extracting\n"
"REP (reply) and QWK message packets (files, usually in PKZIP format).\n"
"\n"
"The `Call-out Command Line` is executed when your system attempts a packet\n"
"exchange with the QWKnet hub (e.g. executes a script).\n"
"\n"
"`Kludge Lines` (e.g. @TZ, @VIA, @MSGID, @REPLY) provide information not\n"
"available in standard QWK message headers, but are superfluous when the\n"
"HEADERS.DAT file is supported and used.\n"
"\n"
"The `VOTING.DAT` file is the distributed QWKnet voting system supported\n"
"in Synchronet v3.17 and later\n"
"\n"
"The `HEADERS.DAT` file provides all the same information that can be\n"
"found in Kludge Lines and also addresses the 25-character QWK field\n"
"length limits. HEADERS.DAT is supported in Synchronet v3.15 and later.\n"
"\n"
"`Extended (QWKE) Packets` are not normally used in QWK Networking.\n"
"Setting this to `Yes` enables some QWKE-specific Kludge Lines that are\n"
"superfluous when the HEADERS.DAT file is supported and used.\n"
"\n"
"`Exported Ctrl-A Codes` determines how Synchronet attribute/color\n"
"codes in messages are exported into the QWK network packets. This\n"
"may be set to `Leave in` (retain), `Expand` (to ANSI), or `Strip` (remove).\n"
"This setting is used for QWKnet NetMail messages and may over-ride the\n"
"equivalent setting for each sub-board."
;
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&qhub_dflt,0
,str,opt)) {
......@@ -1052,6 +1084,30 @@ while(!done) {
}
break;
case 7:
cfg.qhub[num]->misc^=QHUB_NOKLUDGES;
uifc.changes=1;
break;
case 8:
cfg.qhub[num]->misc^=QHUB_NOVOTING;
uifc.changes=1;
break;
case 9:
cfg.qhub[num]->misc^=QHUB_NOHEADERS;
uifc.changes=1;
break;
case 10:
cfg.qhub[num]->misc^=QHUB_EXT;
uifc.changes=1;
break;
case 11:
i = cfg.qhub[num]->misc&QHUB_CTRL_A;
i++;
if(i == QHUB_CTRL_A) i = 0;
cfg.qhub[num]->misc &= ~QHUB_CTRL_A;
cfg.qhub[num]->misc |= i;
uifc.changes=1;
break;
case 12:
qhub_sub_edit(num);
break;
}
......@@ -1150,11 +1206,11 @@ while(1) {
cfg.qhub[num]->mode[n]=cfg.qhub[num]->mode[n-1];
}
if(!m)
cfg.qhub[num]->mode[j]=A_STRIP;
cfg.qhub[num]->mode[j]=QHUB_STRIP;
else if(m==1)
cfg.qhub[num]->mode[j]=A_LEAVE;
cfg.qhub[num]->mode[j]=QHUB_RETCTLA;
else
cfg.qhub[num]->mode[j]=A_EXPAND;
cfg.qhub[num]->mode[j]=QHUB_EXPCTLA;
cfg.qhub[num]->sub[j]=l;
cfg.qhub[num]->conf[j]=atoi(str);
cfg.qhub[num]->subs++;
......@@ -1185,8 +1241,8 @@ while(1) {
sprintf(opt[n++],"%-22.22s%u"
,"Conference Number",cfg.qhub[num]->conf[j]);
sprintf(opt[n++],"%-22.22s%s"
,"Ctrl-A Codes",cfg.qhub[num]->mode[j]==A_STRIP ?
"Strip out" : cfg.qhub[num]->mode[j]==A_LEAVE ?
,"Ctrl-A Codes",cfg.qhub[num]->mode[j]==QHUB_STRIP ?
"Strip out" : cfg.qhub[num]->mode[j]==QHUB_RETCTLA ?
"Leave in" : "Expand to ANSI");
opt[n][0]=0;
uifc.helpbuf=
......@@ -1246,11 +1302,11 @@ while(1) {
,"Ctrl-A Codes",opt);
uifc.changes=1;
if(!m)
cfg.qhub[num]->mode[j]=A_STRIP;
cfg.qhub[num]->mode[j]=QHUB_STRIP;
else if(m==1)
cfg.qhub[num]->mode[j]=A_LEAVE;
cfg.qhub[num]->mode[j]=QHUB_RETCTLA;
else if(m==2)
cfg.qhub[num]->mode[j]=A_EXPAND;
cfg.qhub[num]->mode[j]=QHUB_EXPCTLA;
}
}
}
......
/* scfgdefs.h */
/* Synchronet configuration structure (scfg_t) definition */
/* $Id$ */
......@@ -317,6 +315,7 @@ typedef struct { /* QWK Network Hub */
*conf; /* Conference number of ea. */
ulong *sub; /* Number of local sub-board for ea. */
time32_t last; /* Last network attempt */
uint32_t misc; /* QHUB_* flags */
} qhub_t;
......
......@@ -643,8 +643,10 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error)
else
continue;
if(cfg->qhub[i]->sub[cfg->qhub[i]->subs]!=INVALID_SUB)
cfg->qhub[i]->subs++; }
for(j=0;j<32;j++)
cfg->qhub[i]->subs++;
}
get_int(cfg->qhub[i]->misc, instream);
for(j=0;j<30;j++)
get_int(n,instream);
}
......
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