Commit 5aadeb4d authored by rswindell's avatar rswindell

Don't allow replies to messages with the "NoReply" attribute set.

Don't prompt for "delete mail from everyone" when there is only one e-mail
waiting for the user.
Use some existing text.dat entries (some old and some recently added) where
identical static strings were still being used for no apparent reason.
Added several text.dat entries for the QWK settings menu, node status, and
some other single-line messages (replacing static strings).
parent 2fac3f43
......@@ -271,7 +271,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode)
smb_close(&smb);
smb_stack(&smb,SMB_STACK_POP);
attr(cfg.color[clr_err]);
bputs("Duplicate message!\r\n");
bputs(text[CantPostMsg]);
return(false);
}
}
......
......@@ -1934,7 +1934,7 @@ bool sbbs_t::select_shell(void)
int i;
for(i=0;i<cfg.total_shells;i++)
uselect(1,i,"Command Shell",cfg.shell[i]->name,cfg.shell[i]->ar);
uselect(1,i,text[CommandShellHeading],cfg.shell[i]->name,cfg.shell[i]->ar);
if((i=uselect(0,useron.shell,0,0,0))>=0) {
useron.shell=i;
putuserrec(&cfg,useron.number,U_SHELL,8,cfg.shell[i]->code);
......@@ -1948,7 +1948,7 @@ bool sbbs_t::select_editor(void)
int i;
for(i=0;i<cfg.total_xedits;i++)
uselect(1,i,"External Editor",cfg.xedit[i]->name,cfg.xedit[i]->ar);
uselect(1,i,text[ExternalEditorHeading],cfg.xedit[i]->name,cfg.xedit[i]->ar);
if(useron.xedit) useron.xedit--;
if((i=uselect(0,useron.xedit,0,0,0))>=0) {
useron.xedit=i+1;
......
......@@ -398,23 +398,19 @@ void sbbs_t::nodelist(void)
}
}
static char* node_connection_desc(ushort conn, char* str)
static char* node_connection_desc(sbbs_t* sbbs, ushort conn, char* str)
{
switch(conn) {
case NODE_CONNECTION_LOCAL:
strcpy(str,"Locally");
break;
return "Locally"; /* obsolete */
case NODE_CONNECTION_TELNET:
strcpy(str,"via telnet");
break;
return sbbs->text[NodeConnectionTelnet];
case NODE_CONNECTION_RLOGIN:
strcpy(str,"via rlogin");
break;
return sbbs->text[NodeConnectionRLogin];
case NODE_CONNECTION_SSH:
strcpy(str,"via ssh");
break;
return sbbs->text[NodeConnectionSSH];
default:
sprintf(str,"at %ubps",conn);
sprintf(str,sbbs->text[NodeConnectionModem],conn);
break;
}
......@@ -435,36 +431,34 @@ void sbbs_t::printnodedat(uint number, node_t* node)
attr(cfg.color[clr_nodestatus]);
switch(node->status) {
case NODE_WFC:
bputs("Waiting for call");
bputs(text[NodeStatusWaitingForCall]);
break;
case NODE_OFFLINE:
bputs("Offline");
bputs(text[NodeStatusOffline]);
break;
case NODE_NETTING:
bputs("Networking");
bputs("Networking"); /* obsolete */
break;
case NODE_LOGON:
bputs("At logon prompt");
bputs(text[NodeStatusLogon]);
bputs(node_connection_desc(this, node->connection, tmp));
break;
case NODE_EVENT_WAITING:
bputs("Waiting for all nodes to become inactive");
bputs(text[NodeStatusEventWaiting]);
break;
case NODE_EVENT_LIMBO:
bprintf("Waiting for node %d to finish external event",node->aux);
bprintf(text[NodeStatusEventLimbo],node->aux);
break;
case NODE_EVENT_RUNNING:
bputs("Running external event");
bputs(text[NodeStatusEventRunning]);
break;
case NODE_NEWUSER:
attr(cfg.color[clr_nodeuser]);
bputs("New user");
attr(cfg.color[clr_nodestatus]);
bputs(" applying for access ");
bputs(node_connection_desc(node->connection, tmp));
bputs(text[NodeStatusNewUser]);
bputs(node_connection_desc(this, node->connection, tmp));
break;
case NODE_QUIET:
if(!SYSOP) {
bputs("Waiting for call");
bputs(text[NodeStatusWaitingForCall]);
break;
}
case NODE_INUSE:
......@@ -475,7 +469,7 @@ void sbbs_t::printnodedat(uint number, node_t* node)
}
attr(cfg.color[clr_nodeuser]);
if(node->misc&NODE_ANON && !SYSOP)
bputs("UNKNOWN USER");
bputs(text[UNKNOWN_USER]);
else
bputs(username(&cfg,node->useron,tmp));
attr(cfg.color[clr_nodestatus]);
......@@ -583,7 +577,7 @@ void sbbs_t::printnodedat(uint number, node_t* node)
default:
bputs(ultoa(node->action,tmp,10));
break; }
bprintf(" %s",node_connection_desc(node->connection, tmp));
bprintf(" %s",node_connection_desc(this, node->connection, tmp));
if(node->action==NODE_DLNG) {
if(cfg.sys_misc&SM_MILITARY) {
hour=node->aux/60;
......
......@@ -263,7 +263,7 @@ BOOL sbbs_t::newuser()
if(getstr(useron.location,LEN_LOCATION,kmode)
&& (cfg.uq&UQ_NOCOMMAS || strchr(useron.location,',')))
break;
bputs("\r\nYou must include a comma between the city and state.\r\n");
bputs(text[CommaInLocationRequired]);
useron.location[0]=0;
}
if(cfg.uq&UQ_ADDRESS)
......@@ -347,9 +347,9 @@ BOOL sbbs_t::newuser()
useron.xedit=i+1;
if(cfg.total_xedits && cfg.uq&UQ_XEDIT) {
if(yesno("Use an external message editor")) {
if(yesno(text[UseExternalEditorQ])) {
for(i=0;i<cfg.total_xedits;i++)
uselect(1,i,"External Editor",cfg.xedit[i]->name,cfg.xedit[i]->ar);
uselect(1,i,text[ExternalEditorHeading],cfg.xedit[i]->name,cfg.xedit[i]->ar);
if((int)(i=uselect(0,useron.xedit ? useron.xedit-1 : 0,0,0,0))>=0)
useron.xedit=i+1;
} else
......@@ -358,7 +358,7 @@ BOOL sbbs_t::newuser()
if(cfg.total_shells>1 && cfg.uq&UQ_CMDSHELL) {
for(i=0;i<cfg.total_shells;i++)
uselect(1,i,"Command Shell",cfg.shell[i]->name,cfg.shell[i]->ar);
uselect(1,i,text[CommandShellHeading],cfg.shell[i]->name,cfg.shell[i]->ar);
if((int)(i=uselect(0,useron.shell,0,0,0))>=0)
useron.shell=i;
}
......
......@@ -336,7 +336,7 @@ bool sbbs_t::postmsg(uint subnum, smbmsg_t *remsg, long wm_mode)
smb_close(&smb);
smb_stack(&smb,SMB_STACK_POP);
attr(cfg.color[clr_err]);
bputs("Duplicate message!\r\n");
bputs(text[CantPostMsg]);
return(false);
}
}
......
......@@ -411,7 +411,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
smb_putmsg(&smb,&msg);
}
if(!(msg.hdr.attr&MSG_PERMANENT)
&& ((msg.hdr.attr&MSG_KILLREAD && msg.hdr.attr&MSG_READ)
&& (((msg.hdr.attr&MSG_KILLREAD) && (msg.hdr.attr&MSG_READ))
|| (useron.qwk&QWK_DELMAIL))) {
msg.hdr.attr|=MSG_DELETE;
msg.idx.attr=msg.hdr.attr;
......@@ -500,53 +500,40 @@ void sbbs_t::qwk_sec()
if(ch=='C') {
while(online) {
CLS;
bputs("\1n\1gQWK Settings:\1n\r\n\r\n");
bprintf("\1hA\1n) %-30s: \1h%s\r\n"
,"Ctrl-A Color Codes"
bprintf(text[QWKSettingsHdr],useron.alias,useron.number);
bprintf(text[QWKSettingsCtrlA]
,useron.qwk&QWK_EXPCTLA
? "Expand to ANSI" : useron.qwk&QWK_RETCTLA ? "Leave in"
: "Strip");
bprintf("\1hT\1n) %-30s: \1h%s\r\n"
,"Archive Type"
,useron.tmpext);
bprintf("\1hE\1n) %-30s: \1h%s\r\n"
,"Include E-mail Messages"
bprintf(text[QWKSettingsArchive],useron.tmpext);
bprintf(text[QWKSettingsEmail]
,useron.qwk&QWK_EMAIL ? "Un-read Only"
: useron.qwk&QWK_ALLMAIL ? text[Yes] : text[No]);
bprintf("\1hI\1n) %-30s: \1h%s\r\n"
,"Include File Attachments"
,useron.qwk&QWK_ATTACH ? text[Yes] : text[No]);
bprintf("\1hD\1n) %-30s: \1h%s\r\n"
,"Delete E-mail Automatically"
,useron.qwk&QWK_DELMAIL ? text[Yes]:text[No]);
bprintf("\1hF\1n) %-30s: \1h%s\r\n"
,"Include New Files List"
if(useron.qwk&(QWK_ALLMAIL|QWK_EMAIL)) {
bprintf(text[QWKSettingsAttach]
,useron.qwk&QWK_ATTACH ? text[Yes] : text[No]);
bprintf(text[QWKSettingsDeleteEmail]
,useron.qwk&QWK_DELMAIL ? text[Yes]:text[No]);
}
bprintf(text[QWKSettingsNewFilesList]
,useron.qwk&QWK_FILES ? text[Yes]:text[No]);
bprintf("\1hN\1n) %-30s: \1h%s\r\n"
,"Include Index Files"
bprintf(text[QWKSettingsIndex]
,useron.qwk&QWK_NOINDEX ? text[No]:text[Yes]);
bprintf("\1hC\1n) %-30s: \1h%s\r\n"
,"Include Control Files"
bprintf(text[QWKSettingsControl]
,useron.qwk&QWK_NOCTRL ? text[No]:text[Yes]);
bprintf("\1hH\1n) %-30s: \1h%s\r\n"
,"Include HEADERS.DAT"
bprintf(text[QWKSettingsHeaders]
,useron.qwk&QWK_HEADERS ? text[Yes]:text[No]);
bprintf("\1hY\1n) %-30s: \1h%s\r\n"
,"Include Messages from You"
bprintf(text[QWKSettingsBySelf]
,useron.qwk&QWK_BYSELF ? text[Yes]:text[No]);
bprintf("\1hZ\1n) %-30s: \1h%s\r\n"
,"Include Time Zone (TZ)"
bprintf(text[QWKSettingsTimeZone]
,useron.qwk&QWK_TZ ? text[Yes]:text[No]);
bprintf("\1hV\1n) %-30s: \1h%s\1n\r\n"
,"Include Message Path (VIA)"
bprintf(text[QWKSettingsVIA]
,useron.qwk&QWK_VIA ? text[Yes]:text[No]);
bprintf("\1hM\1n) %-30s: \1h%s\1n\r\n"
,"Include Message/Reply IDs"
bprintf(text[QWKSettingsMsgID]
,useron.qwk&QWK_MSGID ? text[Yes]:text[No]);
bprintf("\1hX\1n) %-30s: \1h%s\1n\r\n"
,"Extended (QWKE) Packet Format"
bprintf(text[QWKSettingsExtended]
,useron.qwk&QWK_EXT ? text[Yes]:text[No]);
bputs(text[UserDefaultsWhich]);
bputs(text[QWKSettingsWhich]);
ch=(char)getkeys("AEDFHIOQTYMNCXZV",0);
if(sys_status&SS_ABORT || !ch || ch=='Q' || !online)
break;
......@@ -563,7 +550,7 @@ void sbbs_t::qwk_sec()
break;
case 'T':
for(i=0;i<cfg.total_fcomps;i++)
uselect(1,i,"Archive Types",cfg.fcomp[i]->ext,cfg.fcomp[i]->ar);
uselect(1,i,text[ArchiveTypeHeading],cfg.fcomp[i]->ext,cfg.fcomp[i]->ar);
s=uselect(0,0,0,0,0);
if(s>=0) {
strcpy(useron.tmpext,cfg.fcomp[s]->ext);
......
......@@ -360,8 +360,8 @@ void sbbs_t::readmail(uint usernumber, int which)
if(which==MAIL_SENT)
break;
if((msg.hdr.attr&MSG_ANONYMOUS) && !SYSOP) {
bputs(text[CantReplyToAnonMsg]);
if((msg.hdr.attr&(MSG_NOREPLY|MSG_ANONYMOUS)) && !SYSOP) {
bputs(text[CantReplyToMsg]);
break;
}
......@@ -435,7 +435,7 @@ void sbbs_t::readmail(uint usernumber, int which)
/* Case 'D': must follow! */
case 'D': /* Delete last piece (toggle) */
if(msg.hdr.attr&MSG_PERMANENT) {
bputs("\r\nPermanent message.\r\n");
bputs(text[CantDeleteMsg]);
domsg=0;
break;
}
......@@ -726,7 +726,7 @@ void sbbs_t::readmail(uint usernumber, int which)
SAFEPRINTF(str,text[DeleteMailQ],"everyone");
if(which==MAIL_YOUR
&& getmail(&cfg, usernumber, /* sent: */FALSE)
&& getmail(&cfg, usernumber, /* sent: */FALSE)>1
&& bputs(crlf)
&& !noyes(str))
delallmail(usernumber, MAIL_YOUR);
......
......@@ -361,7 +361,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
find_buf[0]=0;
cursubnum=subnum; /* for ARS */
if(!chk_ar(cfg.sub[subnum]->read_ar,&useron,&client)) {
bprintf("\1n\r\nYou can't read messages on %s %s\r\n"
bprintf(text[CantReadSub]
,cfg.grp[cfg.sub[subnum]->grp]->sname,cfg.sub[subnum]->sname);
return(0);
}
......@@ -712,6 +712,10 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
bputs(text[CantPostOnSub]);
break;
}
if(msg.hdr.attr&MSG_NOREPLY && !sub_op(subnum)) {
bputs(text[CantReplyToMsg]);
break;
}
quotemsg(&msg,/* include tails: */FALSE);
FREE_AND_NULL(post);
postmsg(subnum,&msg,WM_QUOTE);
......@@ -742,7 +746,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
break;
}
if(cfg.sub[subnum]->misc&SUB_DELLAST && smb.curmsg!=(smb.msgs-1)) {
bputs("\1n\r\nCan only delete last message.\r\n");
bputs(text[CantDeleteMsg]);
domsg=0;
break;
}
......@@ -755,7 +759,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
}
}
if(msg.hdr.attr&MSG_PERMANENT) {
bputs("\1n\r\nMessage is marked permanent.\r\n");
bputs(text[CantDeleteMsg]);
domsg=0;
break;
}
......@@ -798,13 +802,12 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
case 'E': /* edit last post */
if(!sub_op(subnum)) {
if(!(cfg.sub[subnum]->misc&SUB_EDIT)) {
bputs("\1n\r\nCan't edit messages on this message base.\r\n");
// bputs(text[CantDeletePosts]);
bputs(text[CantEditMsg]);
domsg=0;
break;
}
if(cfg.sub[subnum]->misc&SUB_EDITLAST && smb.curmsg!=(smb.msgs-1)) {
bputs("\1n\r\nCan only edit last message.\r\n");
bputs(text[CantEditMsg]);
domsg=0;
break;
}
......@@ -848,8 +851,8 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
break;
case 'M': /* Reply to last post in mail */
domsg=0;
if(msg.hdr.attr&MSG_ANONYMOUS && !sub_op(subnum)) {
bputs(text[CantReplyToAnonMsg]);
if(msg.hdr.attr&(MSG_NOREPLY|MSG_ANONYMOUS) && !sub_op(subnum)) {
bputs(text[CantReplyToMsg]);
break;
}
if(!sub_op(subnum) && msg.hdr.attr&MSG_PRIVATE
......@@ -941,7 +944,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
while(online) {
if(!(useron.misc&EXPERT))
menu("sysmscan");
bprintf("\r\n\1y\1hOperator: \1w");
bputs(text[OperatorPrompt]);
strcpy(str,"?CEHMPQUV");
if(SYSOP)
strcat(str,"S");
......
......@@ -93,7 +93,7 @@ enum {
,MailWaitingLstFmt
,StartWithN
,ReadingMail
,CantReplyToAnonMsg
,CantReplyToMsg
,Regarding
,RegardingByOn
,RegardingByToOn
......@@ -199,7 +199,7 @@ enum {
,StatsFeedbacksToday
,ChUserPrompt
,ChUserPwPrompt
,Unused156
,CommaInLocationRequired
,ErrorLogHdr
,DeleteErrorLogQ
,DirectoryDoesNotExist
......@@ -773,6 +773,38 @@ enum {
,CommandShellHeading
,ArchiveTypeHeading
,ValidatePostQ
,NodeStatusWaitingForCall
,NodeStatusLogon
,NodeStatusNewUser
,NodeStatusOffline
,NodeStatusEventWaiting
,NodeStatusEventRunning
,NodeStatusEventLimbo
,NodeConnectionTelnet
,NodeConnectionRLogin
,NodeConnectionSSH
,NodeConnectionModem
,QWKSettingsHdr
,QWKSettingsCtrlA
,QWKSettingsArchive
,QWKSettingsEmail
,QWKSettingsAttach
,QWKSettingsDeleteEmail
,QWKSettingsNewFilesList
,QWKSettingsIndex
,QWKSettingsControl
,QWKSettingsHeaders
,QWKSettingsBySelf
,QWKSettingsTimeZone
,QWKSettingsVIA
,QWKSettingsMsgID
,QWKSettingsExtended
,QWKSettingsWhich
,CantEditMsg
,CantDeleteMsg
,CantReadSub
,CantPostMsg
,OperatorPrompt
,TOTAL_TEXT
};
......
This diff is collapsed.
......@@ -1617,7 +1617,7 @@ bool sbbs_t::exec_xtrn(uint xtrnnum)
c=cfg.sys_nodes+1;
}
else if(node.misc&NODE_ANON)
SAFECOPY(str,"UNKNOWN USER");
SAFECOPY(str,text[UNKNOWN_USER]);
else
username(&cfg,node.useron,str);
bprintf(text[UserRunningXtrn],str
......
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