diff --git a/ctrl/text.dat b/ctrl/text.dat index 0d22e8305f3511ea472cf5872dfdb69e34a244a7..2aadbc5ebb6cf6fdc6010618ab9d7db956d9a9de 100644 --- a/ctrl/text.dat +++ b/ctrl/text.dat @@ -915,7 +915,7 @@ "\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 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 "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 diff --git a/src/sbbs3/email.cpp b/src/sbbs3/email.cpp index c5e01c1caa932b6cd6832e7f781fce5cdf544848..7b77e7be0874710b3070b1b87c910bb3c0834703 100644 --- a/src/sbbs3/email.cpp +++ b/src/sbbs3/email.cpp @@ -258,8 +258,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, int mode, smb_unlocksmbhdr(&smb); smb_close(&smb); smb_stack(&smb,SMB_STACK_POP); - attr(cfg.color[clr_err]); - bputs(text[CantPostMsg]); + bprintf(text[CantPostMsg], i == SMB_DUPE_MSG ? "duplicate" : "other"); return(false); } } diff --git a/src/sbbs3/postmsg.cpp b/src/sbbs3/postmsg.cpp index f7630d7449e6837e4adf34d6c4f9de63162fe30e..90de3d611e92765c16b5d6c56294f2177b97e600 100644 --- a/src/sbbs3/postmsg.cpp +++ b/src/sbbs3/postmsg.cpp @@ -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)); free(msgbuf); - if(i==SMB_DUPE_MSG) { - attr(cfg.color[clr_err]); - bprintf(text[CantPostMsg], smb.last_error); - } else if(i!=SMB_SUCCESS) + if(i==SMB_DUPE_MSG) + bprintf(text[CantPostMsg], "duplicate"); + else if(i!=SMB_SUCCESS) errormsg(WHERE,ERR_WRITE,smb.file,i,smb.last_error); smb_close(&smb); smb_stack(&smb,SMB_STACK_POP); smb_freemsgmem(&msg); - if(i!=SMB_SUCCESS) - return(false); + if(i!=SMB_SUCCESS) { + 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++; user_posted_msg(&cfg, &useron, 1);