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, There is no check anymore for a valid tty with network calls,
instead a fake ttyinfo record is created. Modem/ISDN and instead a fake ttyinfo record is created. Modem/ISDN and
console still need a valid configured tty. console still need a valid configured tty.
Fixed a bug in the email menu that would let the current
mailbox disappear.
mbnewusr: mbnewusr:
There is no check anymore for a valid tty with network calls, There is no check anymore for a valid tty with network calls,

View File

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

View File

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