Add Option to list new mail areas to menu option 201
This commit is contained in:
parent
78a226ef01
commit
01f7d384f4
@ -1531,8 +1531,10 @@ void MsgArea_List(char *Option)
|
|||||||
int iAreaCount = 6, Recno = 0;
|
int iAreaCount = 6, Recno = 0;
|
||||||
int iOldArea = 0, iAreaNum = 0;
|
int iOldArea = 0, iAreaNum = 0;
|
||||||
int iGotArea = FALSE; /* Flag to check if user typed in area */
|
int iGotArea = FALSE; /* Flag to check if user typed in area */
|
||||||
|
int iCheckNew = FALSE; /* Flag to check for new mail in area */
|
||||||
long offset;
|
long offset;
|
||||||
char *temp;
|
char *temp;
|
||||||
|
lastread LR;
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
|
|
||||||
@ -1558,10 +1560,16 @@ void MsgArea_List(char *Option)
|
|||||||
iAreaNum = (ftell(pAreas) - msgshdr.hdrsize) / (msgshdr.recsize + msgshdr.syssize);
|
iAreaNum = (ftell(pAreas) - msgshdr.hdrsize) / (msgshdr.recsize + msgshdr.syssize);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there are menu options, select area direct.
|
* If there are menu options, parse them first
|
||||||
|
* 1. Check for New Messages in Area (only option that will continue to display list)
|
||||||
|
* 2. Increment Area, return
|
||||||
|
* 3. Decrement Area, return
|
||||||
|
* 4. Select area direct (via area number), return
|
||||||
*/
|
*/
|
||||||
if (strlen(Option) != 0) {
|
if (strlen(Option) != 0) {
|
||||||
|
if (strcmp(Option, "N") == 0) {
|
||||||
|
iCheckNew = TRUE;
|
||||||
|
} else {
|
||||||
if (strcmp(Option, "M+") == 0)
|
if (strcmp(Option, "M+") == 0)
|
||||||
while(TRUE) {
|
while(TRUE) {
|
||||||
iMsgAreaNumber++;
|
iMsgAreaNumber++;
|
||||||
@ -1593,12 +1601,15 @@ void MsgArea_List(char *Option)
|
|||||||
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0))
|
if ((Access(exitinfo.Security, msgs.RDSec)) && (msgs.Active) && (strlen(msgs.Password) == 0))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SetMsgArea(iMsgAreaNumber);
|
SetMsgArea(iMsgAreaNumber);
|
||||||
Syslog('+', "Msg area %lu %s", iMsgAreaNumber, sMsgAreaDesc);
|
Syslog('+', "Msg area %lu %s", iMsgAreaNumber, sMsgAreaDesc);
|
||||||
free(temp);
|
free(temp);
|
||||||
fclose(pAreas);
|
fclose(pAreas);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
Enter(1);
|
Enter(1);
|
||||||
@ -1619,7 +1630,26 @@ void MsgArea_List(char *Option)
|
|||||||
printf("%5d", Recno + 1);
|
printf("%5d", Recno + 1);
|
||||||
|
|
||||||
colour(LIGHTBLUE, BLACK);
|
colour(LIGHTBLUE, BLACK);
|
||||||
|
/* Check for New Mail if N was put on option data */
|
||||||
|
if ( iCheckNew ) {
|
||||||
|
if(Msg_Open(msgs.Base)){
|
||||||
|
MsgBase.Highest = Msg_Highest();
|
||||||
|
LR.UserID = grecno;
|
||||||
|
if ( Msg_GetLastRead(&LR) != TRUE ){
|
||||||
|
LR.HighReadMsg = 0;
|
||||||
|
}
|
||||||
|
if (MsgBase.Highest > LR.HighReadMsg ) {
|
||||||
|
colour(YELLOW, BLACK);
|
||||||
|
printf(" %c ", 42 );
|
||||||
|
} else {
|
||||||
|
printf(" %c ", 46 );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
printf(" %c ", 46 );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
printf(" %c ", 46);
|
printf(" %c ", 46);
|
||||||
|
}
|
||||||
|
|
||||||
colour(CYAN, BLACK);
|
colour(CYAN, BLACK);
|
||||||
printf("%-31s", msgs.Name);
|
printf("%-31s", msgs.Name);
|
||||||
|
Reference in New Issue
Block a user