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 6eff22bc authored by rswindell's avatar rswindell

Using message number instead of time to determine which e-mails should be

deleted after QWK-packing.
parent 5a8e5e0f
......@@ -257,7 +257,7 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
/***********************/
/* Pack E-mail, if any */
/***********************/
qwkmail_time=time(NULL);
qwkmail_last=0;
mail=loadmail(&smb,&mailmsgs,useron.number,0,useron.qwk&QWK_ALLMAIL ? 0
: LM_UNREAD);
if(mailmsgs && !(sys_status&SS_ABORT)) {
......@@ -288,6 +288,8 @@ bool sbbs_t::pack_qwk(char *packet, ulong *msgcnt, bool prepack)
memset(&msg,0,sizeof(msg));
msg.idx=mail[l];
if(msg.idx.number>qwkmail_last)
qwkmail_last=msg.idx.number;
if(!loadmsg(&msg,mail[l].number))
continue;
......
......@@ -95,7 +95,7 @@ bool sbbs_t::pack_rep(uint hubnum)
/***********************/
/* Pack E-mail, if any */
/***********************/
qwkmail_time=time(NULL);
qwkmail_last=0;
mail=loadmail(&smb,&mailmsgs,0,MAIL_YOUR,0);
packedmail=0;
if(mailmsgs) {
......@@ -105,6 +105,8 @@ bool sbbs_t::pack_rep(uint hubnum)
memset(&msg,0,sizeof(msg));
msg.idx=mail[l];
if(msg.idx.number>qwkmail_last)
qwkmail_last=msg.idx.number;
if(!loadmsg(&msg,mail[l].number))
continue;
......@@ -271,7 +273,7 @@ bool sbbs_t::pack_rep(uint hubnum)
deleted=0;
/* Mark as READ and DELETE */
for(l=0;(ulong)l<mailmsgs;l++) {
if(mail[l].time>qwkmail_time)
if(mail[l].number>qwkmail_last)
continue;
memset(&msg,0,sizeof(msg));
msg.idx=mail[l];
......@@ -301,6 +303,7 @@ bool sbbs_t::pack_rep(uint hubnum)
smb_close(&smb);
if(mailmsgs)
FREE(mail);
eprintf("Deleted %d sent NetMail messages",deleted);
}
return(true);
......
......@@ -352,7 +352,7 @@ void sbbs_t::qwk_success(ulong msgcnt, char bi, char prepack)
/* Mark as READ and DELETE */
for(l=0;l<msgs;l++) {
if(mail[l].time>qwkmail_time)
if(mail[l].number>qwkmail_last)
continue;
msg.idx.offset=0;
if(!loadmsg(&msg,mail[l].number))
......
......@@ -652,7 +652,7 @@ public:
/* qwk.cpp */
bool qwklogon;
ulong qwkmail_time;
ulong qwkmail_last;
void qwk_sec(void);
int qwk_route(char *inaddr, char *fulladdr);
void update_qwkroute(char *via);
......
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