Skip to content
Snippets Groups Projects
Commit 7c11e274 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Log more/better messages when message fails to post (e.g. duplicate detected)

It appears I had the idea to make the CantPost text.dat string a format string
before, but never quite finished that change (e.g. made the change to
email.cpp and text.dat too).
parent ba9f4a44
Branches
Tags
No related merge requests found
Pipeline #6589 passed
...@@ -915,7 +915,7 @@ ...@@ -915,7 +915,7 @@
"\1n\r\nSorry, you can't edit this message.\r\n" 757 CantEditMsg "\1n\r\nSorry, you can't edit this message.\r\n" 757 CantEditMsg
"\1n\r\nSorry, you can't delete message #%u.\r\n" 758 CantDeleteMsg "\1n\r\nSorry, you can't delete message #%u.\r\n" 758 CantDeleteMsg
"\1n\r\nSorry, you can't read messages on %s %s\r\n" 759 CantReadSub "\1n\r\nSorry, you can't read messages on %s %s\r\n" 759 CantReadSub
"\1n\r\nSorry, you can't post that message.\r\n" 760 CantPostMsg "\rSorry, you can't post that message. Reason: %s\r\n" 760 CantPostMsg
"\r\n\1y\1hOperator: \1w" 761 OperatorPrompt "\r\n\1y\1hOperator: \1w" 761 OperatorPrompt
"Add this sub-board to your new-scan list" 762 AddSubToNewScanQ "Add this sub-board to your new-scan list" 762 AddSubToNewScanQ
"\1n\1r\1iWARNING: You are reading messages past the last unvalidated message (%u)" 763 UnvalidatedWarning "\1n\1r\1iWARNING: You are reading messages past the last unvalidated message (%u)" 763 UnvalidatedWarning
......
...@@ -258,8 +258,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, int mode, ...@@ -258,8 +258,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, int mode,
smb_unlocksmbhdr(&smb); smb_unlocksmbhdr(&smb);
smb_close(&smb); smb_close(&smb);
smb_stack(&smb,SMB_STACK_POP); smb_stack(&smb,SMB_STACK_POP);
attr(cfg.color[clr_err]); bprintf(text[CantPostMsg], i == SMB_DUPE_MSG ? "duplicate" : "other");
bputs(text[CantPostMsg]);
return(false); return(false);
} }
} }
......
...@@ -312,17 +312,21 @@ bool sbbs_t::postmsg(int subnum, int wm_mode, smb_t* resmb, smbmsg_t* remsg) ...@@ -312,17 +312,21 @@ bool sbbs_t::postmsg(int subnum, int wm_mode, smb_t* resmb, smbmsg_t* remsg)
i=smb_addmsg(&smb,&msg,storage,dupechk_hashes,xlat,(uchar*)msgbuf, findsig(msgbuf)); i=smb_addmsg(&smb,&msg,storage,dupechk_hashes,xlat,(uchar*)msgbuf, findsig(msgbuf));
free(msgbuf); free(msgbuf);
if(i==SMB_DUPE_MSG) { if(i==SMB_DUPE_MSG)
attr(cfg.color[clr_err]); bprintf(text[CantPostMsg], "duplicate");
bprintf(text[CantPostMsg], smb.last_error); else if(i!=SMB_SUCCESS)
} else if(i!=SMB_SUCCESS)
errormsg(WHERE,ERR_WRITE,smb.file,i,smb.last_error); errormsg(WHERE,ERR_WRITE,smb.file,i,smb.last_error);
smb_close(&smb); smb_close(&smb);
smb_stack(&smb,SMB_STACK_POP); smb_stack(&smb,SMB_STACK_POP);
smb_freemsgmem(&msg); smb_freemsgmem(&msg);
if(i!=SMB_SUCCESS) if(i!=SMB_SUCCESS) {
return(false); if(i == SMB_DUPE_MSG)
llprintf(LOG_NOTICE, "P!", "duplicate message post attempt in %s", cfg.sub[subnum]->code);
else
llprintf(LOG_NOTICE, "P!", "message posting failure (SMB error %d) in %s", i, cfg.sub[subnum]->code);
return false;
}
logon_posts++; logon_posts++;
user_posted_msg(&cfg, &useron, 1); user_posted_msg(&cfg, &useron, 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment