Fixed email box select

This commit is contained in:
Michiel Broek 2005-10-08 21:05:28 +00:00
parent 591dbd09fa
commit 44a118ac28
3 changed files with 25 additions and 16 deletions

View File

@ -15,6 +15,8 @@ v0.81.0 07-Oct-2005
There is no check anymore for a valid tty with network calls,
instead a fake ttyinfo record is created. Modem/ISDN and
console still need a valid configured tty.
Fixed a bug in the email menu that would let the current
mailbox disappear.
mbnewusr:
There is no check anymore for a valid tty with network calls,

View File

@ -654,9 +654,9 @@ void ControlCodeK(int ch)
break;
case 'P':
snprintf(sDataFile, PATH_MAX, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, sMailbox);
SetEmailArea(sMailbox);
LR.UserID = grecno;
if (Msg_Open(sDataFile)) {
if (Msg_Open(sMailpath)) {
if (Msg_GetLastRead(&LR) == TRUE) {
if (LR.HighReadMsg > EmailBase.Highest)
LR.HighReadMsg = EmailBase.Highest;

View File

@ -1040,22 +1040,29 @@ void Choose_Mailbox(char *Option)
void SetEmailArea(char *box)
{
if (!exitinfo.Email)
return;
char *p;
snprintf(sMailpath, PATH_MAX, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, box);
snprintf(sMailbox, 21, "%s", box);
if (!exitinfo.Email)
return;
/*
* Get information from the message base
*/
if (Msg_Open(sMailpath)) {
EmailBase.Lowest = Msg_Lowest();
EmailBase.Highest = Msg_Highest();
EmailBase.Total = Msg_Number();
Msg_Close();
} else
WriteError("Error open JAM %s", sMailpath);
/*
* Use a temp variable because this function can be called line SetEmailArea(sMailbox)
*/
p = xstrcpy(box);
snprintf(sMailpath, PATH_MAX, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, p);
snprintf(sMailbox, 21, "%s", p);
free(p);
/*
* Get information from the message base
*/
if (Msg_Open(sMailpath)) {
EmailBase.Lowest = Msg_Lowest();
EmailBase.Highest = Msg_Highest();
EmailBase.Total = Msg_Number();
Msg_Close();
} else
WriteError("Error open JAM %s", sMailpath);
}