Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 66efa279 authored by rswindell's avatar rswindell

Remove the unpopular "delete mail from everyone" prompt when exiting the

Reading Mail prompt with multiple undeleted mails remaining, instead make
(K)ill All Mail command available, which can be still be reversed before
quitting the reading mail prompt.
parent 77a572c2
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -160,7 +160,7 @@ void sbbs_t::telluser(smbmsg_t* msg)
/************************************************************************/
/* Deletes all mail waiting for user number 'usernumber' */
/************************************************************************/
void sbbs_t::delallmail(uint usernumber, int which)
void sbbs_t::delallmail(uint usernumber, int which, bool permanent)
{
int i;
long l,deleted=0;
......@@ -196,6 +196,8 @@ void sbbs_t::delallmail(uint usernumber, int which)
}
for(l=0;l<msgs;l++) {
msg.idx.offset=0; /* search by number */
if((mail[l].attr&MSG_PERMANENT) && !permanent)
continue;
if(loadmsg(&msg,mail[l].number)) { /* message still there */
msg.hdr.attr|=MSG_DELETE;
msg.hdr.attr&=~MSG_PERMANENT;
......@@ -211,7 +213,7 @@ void sbbs_t::delallmail(uint usernumber, int which)
if(msgs)
free(mail);
if(deleted && cfg.sys_misc&SM_DELEMAIL)
if(permanent && deleted && (cfg.sys_misc&SM_DELEMAIL))
delmail(usernumber,MAIL_ANY);
smb_unlocksmbhdr(&smb);
smb_close(&smb);
......
......@@ -340,7 +340,7 @@ void sbbs_t::readmail(uint usernumber, int which)
bprintf(text[ReadingAllMail],smb.curmsg+1,smb.msgs);
else
bprintf(text[ReadingMail],smb.curmsg+1,smb.msgs);
sprintf(str,"ADFLNQRT?<>[]{}-+");
sprintf(str,"ADKFLNQRT?<>[]{}-+");
if(SYSOP)
strcat(str,"CUSPH");
if(which!=MAIL_YOUR)
......@@ -457,6 +457,12 @@ void sbbs_t::readmail(uint usernumber, int which)
if(smb.curmsg<smb.msgs-1) smb.curmsg++;
else done=1;
break;
case 'K': /* Kill All Mail */
SAFEPRINTF(str,text[DeleteMailQ],"everyone");
if(!noyes(str))
delallmail(usernumber, MAIL_YOUR, /* permanent: */false);
domsg=false;
break;
case 'F': /* Forward last piece */
domsg=0;
bputs(text[ForwardMailTo]);
......@@ -724,13 +730,6 @@ void sbbs_t::readmail(uint usernumber, int which)
if(smb.msgs)
free(mail);
SAFEPRINTF(str,text[DeleteMailQ],"everyone");
if(which==MAIL_YOUR
&& getmail(&cfg, usernumber, /* sent: */FALSE)>1
&& bputs(crlf)
&& !noyes(str))
delallmail(usernumber, MAIL_YOUR);
/***************************************/
/* Delete messages marked for deletion */
/***************************************/
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -500,7 +500,7 @@ public:
/* mail.cpp */
int delmail(uint usernumber,int which);
void telluser(smbmsg_t* msg);
void delallmail(uint usernumber, int which);
void delallmail(uint usernumber, int which, bool permanent=true);
/* getmsg.cpp */
post_t* loadposts(int32_t *posts, uint subnum, ulong ptr, long mode);
......
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