New MPL functions, Mailcheck /NOLIST

This commit is contained in:
mysticbbs 2013-04-22 13:38:23 -04:00
parent 6144608de7
commit 4c66c491d9
4 changed files with 63 additions and 2 deletions

View File

@ -41,6 +41,7 @@ Type
Function GetBaseCompressed (Num: LongInt; Var TempBase: RecMessageBase) : Boolean; Function GetBaseCompressed (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Function GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean; Function GetBaseByIndex (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
Procedure GetMessageStats (List, ShowPrompt, ShowYou: Boolean; Var ListPtr: LongInt; Var TempBase: RecMessageBase; NoFrom, NoRead: Boolean; Var Total, New, Yours: LongInt); Procedure GetMessageStats (List, ShowPrompt, ShowYou: Boolean; Var ListPtr: LongInt; Var TempBase: RecMessageBase; NoFrom, NoRead: Boolean; Var Total, New, Yours: LongInt);
Procedure GetMailStats (Var Total, UnRead: LongInt);
Function GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr; Function GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
Function GetTotalBases (Compressed: Boolean) : LongInt; Function GetTotalBases (Compressed: Boolean) : LongInt;
Function GetTotalMessages (Var TempBase: RecMessageBase) : LongInt; Function GetTotalMessages (Var TempBase: RecMessageBase) : LongInt;
@ -459,6 +460,12 @@ Begin
Continue; Continue;
End; End;
If (TempBase.Flags AND MBPrivate <> 0) And Not Session.User.IsThisUser(TempMsg^.GetTo) Then Begin
TempMsg^.SeekNext;
Continue;
End;
If NoRead And Session.User.IsThisUser(TempMsg^.GetTo) And TempMsg^.IsRcvd Then Begin If NoRead And Session.User.IsThisUser(TempMsg^.GetTo) And TempMsg^.IsRcvd Then Begin
TempMsg^.SeekNext; TempMsg^.SeekNext;
@ -509,6 +516,40 @@ Begin
End; End;
End; End;
Procedure TMsgBase.GetMailStats (Var Total, UnRead: LongInt);
Var
MsgBase : PMsgBaseABS;
TempBase : RecMessageBase;
Begin
Total := 0;
UnRead := 0;
FileMode := 66;
Reset (MBaseFile);
Read (MBaseFile, TempBase);
Close (MBaseFile);
If OpenCreateBase (MsgBase, TempBase) Then Begin
MsgBase^.SeekFirst (1);
While MsgBase^.SeekFound Do Begin
MsgBase^.MsgStartUp;
If Session.User.IsThisUser(MsgBase^.GetTo) Then Begin
Inc (Total);
If Not MsgBase^.IsRcvd Then Inc (UnRead);
End;
MsgBase^.SeekNext;
End;
MsgBase^.CloseMsgBase;
Dispose (MsgBase, Done);
End;
End;
Procedure TMsgBase.SetMessageScan; Procedure TMsgBase.SetMessageScan;
Var Var
Count : Integer; Count : Integer;
@ -3068,6 +3109,16 @@ Begin
Read (MBaseFile, MBase); Read (MBaseFile, MBase);
Close (MBaseFile); Close (MBaseFile);
If Pos('/NOLIST', strUpper(CmdData)) > 0 Then Begin
ReadMessages('E', '', '');
Session.io.OutFullLn (Session.GetPrompt(118));
MBase := TempBase;
Exit;
End;
If OpenCreateBase (MsgBase, MBase) Then Begin If OpenCreateBase (MsgBase, MBase) Then Begin
MsgBase^.SeekFirst (1); MsgBase^.SeekFirst (1);
@ -3112,6 +3163,7 @@ Begin
Session.io.OutFullLn (Session.GetPrompt(118)); Session.io.OutFullLn (Session.GetPrompt(118));
End; End;
End; End;
MBase := TempBase; MBase := TempBase;
End; End;

View File

@ -298,6 +298,8 @@ Begin
AddProc ({$IFDEF MPLPARSER} 'msgeditget', {$ENDIF} 'i', iString); // 545 AddProc ({$IFDEF MPLPARSER} 'msgeditget', {$ENDIF} 'i', iString); // 545
AddProc ({$IFDEF MPLPARSER} 'msgeditset', {$ENDIF} 'is', iNone); // 546 AddProc ({$IFDEF MPLPARSER} 'msgeditset', {$ENDIF} 'is', iNone); // 546
AddProc ({$IFDEF MPLPARSER} 'onekeyrange', {$ENDIF} 'sll', iChar); // 547 AddProc ({$IFDEF MPLPARSER} 'onekeyrange', {$ENDIF} 'sll', iChar); // 547
AddProc ({$IFDEF MPLPARSER} 'getmbasetotal', {$ENDIF} 'o', iLongInt); // 548
AddProc ({$IFDEF MPLPARSER} 'getmailstats', {$ENDIF} 'LL', iNone); // 549
{ END OF PROCEDURE DEFINITIONS } { END OF PROCEDURE DEFINITIONS }

View File

@ -1905,7 +1905,8 @@ Begin
Store (TempBool, 1); Store (TempBool, 1);
End; End;
541 : Begin 541 : Begin
TempBool := GetMBaseStats(Param[1].L, Param[2].O, Param[3].O, LongInt(Pointer(Param[3].vData)^), LongInt(Pointer(Param[4].vData)^), LongInt(Pointer(Param[5].vData)^)); TempBool := GetMBaseStats(Param[1].L, Param[2].O, Param[3].O, LongInt(Pointer(Param[4].vData)^), LongInt(Pointer(Param[5].vData)^), LongInt(Pointer(Param[6].vData)^));
Store (TempBool, 1); Store (TempBool, 1);
End; End;
542 : WriteXY (Param[1].B, Param[2].B, Param[3].B, Param[4].S); 542 : WriteXY (Param[1].B, Param[2].B, Param[3].B, Param[4].S);
@ -1934,6 +1935,12 @@ Begin
Store (TempStr[1], 1); Store (TempStr[1], 1);
End; End;
548 : Begin
TempLong := Session.Msgs.GetTotalBases(Param[1].O);
Store (TempLong, 4);
End;
549 : Session.Msgs.GetMailStats (LongInt(Pointer(Param[1].vData)^), LongInt(Pointer(Param[2].vData)^));
End; End;
End; End;

View File

@ -77,7 +77,7 @@ Type
); );
Const Const
mplVer = '11G'; mplVer = '11Z';
mplVersion = '[MPX ' + mplVer +']' + #26; mplVersion = '[MPX ' + mplVer +']' + #26;
mplVerLength = 10; mplVerLength = 10;
mplExtSource = '.mps'; mplExtSource = '.mps';