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

delallmail() optimization and fix

Optimization:
No need to read and re-write headers that already have the DELETE attribute.

Fix:
Forced permanent removal of deleted messages (e.g. when creating a new user
that's reusing an existing user number), didn't work unless SCFG->Message
Options->Purge Delete E-mail was set to "Immediately" (not the default).
parent dd8d22f4
No related branches found
No related tags found
No related merge requests found
......@@ -197,7 +197,7 @@ int sbbs_t::delallmail(uint usernumber, int which, bool permanent, int lm_mode)
for(u=0;u<msgs;u++) {
progress(text[Deleting], u, msgs);
msg.idx.offset=0; /* search by number */
if((mail[u].attr&MSG_PERMANENT) && !permanent)
if((mail[u].attr&(MSG_DELETE | MSG_PERMANENT)) && !permanent)
continue;
if(loadmsg(&msg,mail[u].number) >= 0) { /* message still there */
msg.hdr.attr|=MSG_DELETE;
......@@ -215,7 +215,7 @@ int sbbs_t::delallmail(uint usernumber, int which, bool permanent, int lm_mode)
if(msgs)
free(mail);
if(permanent && deleted && (cfg.sys_misc&SM_DELEMAIL))
if(deleted && (permanent || (cfg.sys_misc&SM_DELEMAIL)))
delmail(usernumber,MAIL_ANY);
smb_unlocksmbhdr(&smb);
smb_close(&smb);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment