Some code reformatting
This commit is contained in:
parent
eb8cd5aace
commit
6f1c54596b
|
@ -78,9 +78,9 @@ Type
|
||||||
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
||||||
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
||||||
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
||||||
Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
// Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
||||||
Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
// Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
||||||
Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
// Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
||||||
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
||||||
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
||||||
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
||||||
|
@ -437,17 +437,17 @@ Function TMsgBaseABS.IsFAttach: Boolean;
|
||||||
Begin
|
Begin
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function TMsgBaseABS.IsReqRct: Boolean;
|
//Function TMsgBaseABS.IsReqRct: Boolean;
|
||||||
Begin
|
//Begin
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseABS.IsReqAud: Boolean;
|
//Function TMsgBaseABS.IsReqAud: Boolean;
|
||||||
Begin
|
//Begin
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseABS.IsRetRct: Boolean;
|
//Function TMsgBaseABS.IsRetRct: Boolean;
|
||||||
Begin
|
//Begin
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseABS.IsFileReq: Boolean;
|
Function TMsgBaseABS.IsFileReq: Boolean;
|
||||||
Begin
|
Begin
|
||||||
|
|
|
@ -126,8 +126,8 @@ Type
|
||||||
TxtPos : LongInt;
|
TxtPos : LongInt;
|
||||||
TxtEnd : LongInt;
|
TxtEnd : LongInt;
|
||||||
TxtBufStart : LongInt;
|
TxtBufStart : LongInt;
|
||||||
TxtRead : {$IFDEF FPC} Word {$ELSE} LongInt {$ENDIF};
|
TxtRead : Word;
|
||||||
IdxRead : {$IFDEF FPC} Word {$ELSE} LongInt {$ENDIF};
|
IdxRead : Word;
|
||||||
MailType : MsgMailType;
|
MailType : MsgMailType;
|
||||||
BufFile : File;
|
BufFile : File;
|
||||||
LockCount : LongInt;
|
LockCount : LongInt;
|
||||||
|
@ -146,8 +146,8 @@ Type
|
||||||
|
|
||||||
Procedure EditMsgInit; Virtual;
|
Procedure EditMsgInit; Virtual;
|
||||||
Procedure EditMsgSave; Virtual;
|
Procedure EditMsgSave; Virtual;
|
||||||
Constructor Init; {Initialize}
|
Constructor Init;
|
||||||
Destructor Done; Virtual; {Done}
|
Destructor Done; Virtual;
|
||||||
Procedure SetMsgPath (St: String); Virtual; {Set netmail path}
|
Procedure SetMsgPath (St: String); Virtual; {Set netmail path}
|
||||||
Function GetHighMsgNum : LongInt; Virtual; {Get highest netmail msg number in area}
|
Function GetHighMsgNum : LongInt; Virtual; {Get highest netmail msg number in area}
|
||||||
Function LockMsgBase : Boolean; Virtual; {Lock the message base}
|
Function LockMsgBase : Boolean; Virtual; {Lock the message base}
|
||||||
|
@ -205,9 +205,9 @@ Type
|
||||||
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
||||||
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
||||||
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
||||||
Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
// Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
||||||
Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
// Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
||||||
Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
// Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
||||||
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
||||||
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
||||||
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
||||||
|
@ -268,6 +268,7 @@ Begin
|
||||||
New (JamIdx);
|
New (JamIdx);
|
||||||
New (MsgHdr); { this new here messes everything up }
|
New (MsgHdr); { this new here messes everything up }
|
||||||
New (TxtBuf);
|
New (TxtBuf);
|
||||||
|
|
||||||
If ((JM = Nil) Or (JamIdx = Nil) or (MsgHdr = Nil) or (TxtBuf = Nil)) Then Begin
|
If ((JM = Nil) Or (JamIdx = Nil) or (MsgHdr = Nil) or (TxtBuf = Nil)) Then Begin
|
||||||
If JM <> Nil Then Dispose(JM);
|
If JM <> Nil Then Dispose(JM);
|
||||||
If JamIdx <> Nil Then Dispose(JamIdx);
|
If JamIdx <> Nil Then Dispose(JamIdx);
|
||||||
|
@ -277,6 +278,7 @@ Begin
|
||||||
Exit;
|
Exit;
|
||||||
End Else Begin
|
End Else Begin
|
||||||
FillChar(JM^, SizeOf(JM^), #0);
|
FillChar(JM^, SizeOf(JM^), #0);
|
||||||
|
|
||||||
JM^.MsgPath := '';
|
JM^.MsgPath := '';
|
||||||
JM^.IdxStart := -30;
|
JM^.IdxStart := -30;
|
||||||
JM^.IdxRead := 0;
|
JM^.IdxRead := 0;
|
||||||
|
@ -296,11 +298,12 @@ Function JamStrCrc(St: String): LongInt;
|
||||||
Var
|
Var
|
||||||
i: Word;
|
i: Word;
|
||||||
crc: LongInt;
|
crc: LongInt;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
Crc := -1;
|
Crc := -1;
|
||||||
|
|
||||||
For i := 1 to Length(St) Do
|
For i := 1 to Length(St) Do
|
||||||
Crc := Crc32(Ord(LoCase(St[i])), Crc);
|
Crc := Crc32(Ord(LoCase(St[i])), Crc);
|
||||||
|
|
||||||
JamStrCrc := Crc;
|
JamStrCrc := Crc;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -709,7 +712,7 @@ Begin
|
||||||
WriteError := IoResult;
|
WriteError := IoResult;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If ReReadIdx(IdxLoc) = 0 Then;
|
ReReadIdx(IdxLoc);
|
||||||
|
|
||||||
(* new shit begin *)
|
(* new shit begin *)
|
||||||
TmpHdr := MsgHdr^.JamHdr;
|
TmpHdr := MsgHdr^.JamHdr;
|
||||||
|
@ -727,9 +730,9 @@ Begin
|
||||||
Seek (JM^.HdrFile, FileSize(JM^.HdrFile));
|
Seek (JM^.HdrFile, FileSize(JM^.HdrFile));
|
||||||
BlockWrite (JM^.HdrFile, MsgHdr^, SizeOf(MsgHdr^.JamHdr) + MsgHdr^.JamHdr.SubFieldLen);
|
BlockWrite (JM^.HdrFile, MsgHdr^, SizeOf(MsgHdr^.JamHdr) + MsgHdr^.JamHdr.SubFieldLen);
|
||||||
|
|
||||||
If WriteIdx = 0 Then;
|
WriteIdx;
|
||||||
|
|
||||||
If UnLockMsgBase Then; {unlock msg base}
|
UnLockMsgBase;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function TMsgBaseJAM.WriteMsg: Word;
|
Function TMsgBaseJAM.WriteMsg: Word;
|
||||||
|
@ -741,20 +744,24 @@ Function TMsgBaseJAM.WriteMsg: Word;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
WriteError := 0;
|
WriteError := 0;
|
||||||
|
|
||||||
If LastSoft Then Begin
|
If LastSoft Then Begin
|
||||||
DoChar(#13);
|
DoChar(#13);
|
||||||
DoChar(#10);
|
DoChar(#10);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If WriteError = 0 Then Begin
|
If WriteError = 0 Then Begin
|
||||||
MsgHdr^.JamHdr.Signature[1] := 'J';{Set signature}
|
MsgHdr^.JamHdr.Signature[1] := 'J';{Set signature}
|
||||||
MsgHdr^.JamHdr.Signature[2] := 'A';
|
MsgHdr^.JamHdr.Signature[2] := 'A';
|
||||||
MsgHdr^.JamHdr.Signature[3] := 'M';
|
MsgHdr^.JamHdr.Signature[3] := 'M';
|
||||||
MsgHdr^.JamHdr.Signature[4] := #0;
|
MsgHdr^.JamHdr.Signature[4] := #0;
|
||||||
|
|
||||||
Case JM^.MailType of
|
Case JM^.MailType of
|
||||||
mmtNormal : SetAttr1 (Jam_TypeLocal, True);
|
mmtNormal : SetAttr1 (Jam_TypeLocal, True);
|
||||||
mmtEchoMail : SetAttr1 (Jam_TypeEcho, True);
|
mmtEchoMail : SetAttr1 (Jam_TypeEcho, True);
|
||||||
mmtNetMail : SetAttr1 (Jam_TypeNet, True);
|
mmtNetMail : SetAttr1 (Jam_TypeNet, True);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
MsgHdr^.JamHdr.Rev := 1;
|
MsgHdr^.JamHdr.Rev := 1;
|
||||||
MsgHdr^.JamHdr.DateArrived := ToUnixDate(CurDateDos); {Get date processed}
|
MsgHdr^.JamHdr.DateArrived := ToUnixDate(CurDateDos); {Get date processed}
|
||||||
|
|
||||||
|
@ -778,10 +785,12 @@ Begin
|
||||||
If Not LockMsgBase Then
|
If Not LockMsgBase Then
|
||||||
WriteError := 5;
|
WriteError := 5;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If WriteError = 0 Then Begin {Handle message text}
|
If WriteError = 0 Then Begin {Handle message text}
|
||||||
MsgHdr^.JamHdr.TextOfs := FileSize(JM^.TxtFile);
|
MsgHdr^.JamHdr.TextOfs := FileSize(JM^.TxtFile);
|
||||||
MsgHdr^.JamHdr.MsgNum := GetHighMsgNum + 1;
|
MsgHdr^.JamHdr.MsgNum := GetHighMsgNum + 1;
|
||||||
MsgHdr^.Jamhdr.TextLen := JM^.TxtPos;
|
MsgHdr^.Jamhdr.TextLen := JM^.TxtPos;
|
||||||
|
|
||||||
If JM^.TxtBufStart > 0 Then Begin {Write text using buffer file}
|
If JM^.TxtBufStart > 0 Then Begin {Write text using buffer file}
|
||||||
i := JM^.TxtPos - JM^.TxtBufStart;
|
i := JM^.TxtPos - JM^.TxtBufStart;
|
||||||
BlockWrite(JM^.BufFile, TxtBuf^, i); {write buffer to file}
|
BlockWrite(JM^.BufFile, TxtBuf^, i); {write buffer to file}
|
||||||
|
@ -1274,22 +1283,22 @@ Function TMsgBaseJAM.IsFAttach: Boolean; {Is current msg file attach}
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
Function TMsgBaseJAM.IsReqRct: Boolean; {Is current msg request receipt}
|
//Function TMsgBaseJAM.IsReqRct: Boolean; {Is current msg request receipt}
|
||||||
Begin
|
// Begin
|
||||||
IsReqRct := (MsgHdr^.JamHdr.Attr1 and Jam_RcptReq) <> 0;
|
// IsReqRct := (MsgHdr^.JamHdr.Attr1 and Jam_RcptReq) <> 0;
|
||||||
End;
|
// End;
|
||||||
|
|
||||||
|
|
||||||
Function TMsgBaseJAM.IsReqAud: Boolean; {Is current msg request audit}
|
//Function TMsgBaseJAM.IsReqAud: Boolean; {Is current msg request audit}
|
||||||
Begin
|
// Begin
|
||||||
IsReqAud := (MsgHdr^.JamHdr.Attr1 and Jam_ConfmReq) <> 0;
|
// IsReqAud := (MsgHdr^.JamHdr.Attr1 and Jam_ConfmReq) <> 0;
|
||||||
End;
|
// End;
|
||||||
|
|
||||||
|
|
||||||
Function TMsgBaseJAM.IsRetRct: Boolean; {Is current msg a return receipt}
|
//Function TMsgBaseJAM.IsRetRct: Boolean; {Is current msg a return receipt}
|
||||||
Begin
|
// Begin
|
||||||
IsRetRct := False;
|
// IsRetRct := False;
|
||||||
End;
|
// End;
|
||||||
|
|
||||||
|
|
||||||
Function TMsgBaseJAM.IsFileReq: Boolean; {Is current msg a file request}
|
Function TMsgBaseJAM.IsFileReq: Boolean; {Is current msg a file request}
|
||||||
|
|
|
@ -101,7 +101,7 @@ Const
|
||||||
SqISize : Word = SizeOf(SqIdxType);
|
SqISize : Word = SizeOf(SqIdxType);
|
||||||
|
|
||||||
Const
|
Const
|
||||||
SqTxtBufferSize = 16000; {reduced from 34000 to 16000. this should }
|
SqTxtBufferSize = 16000;
|
||||||
{handle 200 lines x 80 chars EASILY }
|
{handle 200 lines x 80 chars EASILY }
|
||||||
Type
|
Type
|
||||||
SqInfoType = Record
|
SqInfoType = Record
|
||||||
|
@ -224,9 +224,9 @@ Type
|
||||||
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
|
||||||
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
Function IsSent: Boolean; Virtual; {Is current msg sent}
|
||||||
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
|
||||||
Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
// Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
|
||||||
Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
// Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
|
||||||
Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
// Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
|
||||||
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
|
||||||
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
Function IsRcvd: Boolean; Virtual; {Is current msg received}
|
||||||
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
|
||||||
|
@ -298,12 +298,14 @@ Constructor TMsgBaseSquish.Init;
|
||||||
Begin
|
Begin
|
||||||
New (SqInfo);
|
New (SqInfo);
|
||||||
New (FreeArray);
|
New (FreeArray);
|
||||||
|
|
||||||
If ((SqInfo = nil) or (FreeArray = nil)) Then Begin
|
If ((SqInfo = nil) or (FreeArray = nil)) Then Begin
|
||||||
If SqInfo <> Nil Then Dispose(SqInfo);
|
If SqInfo <> Nil Then Dispose(SqInfo);
|
||||||
If FreeArray <> Nil Then Dispose(FreeArray);
|
If FreeArray <> Nil Then Dispose(FreeArray);
|
||||||
Fail;
|
Fail;
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
SqInfo^.SqdOpened := False;
|
SqInfo^.SqdOpened := False;
|
||||||
SqInfo^.SqiOpened := False;
|
SqInfo^.SqiOpened := False;
|
||||||
SqInfo^.FN := '';
|
SqInfo^.FN := '';
|
||||||
|
@ -320,6 +322,7 @@ Begin
|
||||||
If SqInfo^.SqIAlloc > 0 Then
|
If SqInfo^.SqIAlloc > 0 Then
|
||||||
If SqIdx <> Nil Then
|
If SqIdx <> Nil Then
|
||||||
FreeMem(SqIdx, SqInfo^.SqiAlloc * SizeOf(SqIdxType));
|
FreeMem(SqIdx, SqInfo^.SqiAlloc * SizeOf(SqIdxType));
|
||||||
|
|
||||||
Dispose(FreeArray);
|
Dispose(FreeArray);
|
||||||
Dispose(SqInfo);
|
Dispose(SqInfo);
|
||||||
End;
|
End;
|
||||||
|
@ -1268,20 +1271,20 @@ Begin
|
||||||
IsFAttach := ((SqInfo^.MsgHdr.Attr and SqMsgFile) <> 0);
|
IsFAttach := ((SqInfo^.MsgHdr.Attr and SqMsgFile) <> 0);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function TMsgBaseSquish.IsReqRct: Boolean; {Is current msg request receipt}
|
//Function TMsgBaseSquish.IsReqRct: Boolean; {Is current msg request receipt}
|
||||||
Begin
|
//Begin
|
||||||
IsReqRct := ((SqInfo^.MsgHdr.Attr and SqMsgRRQ) <> 0);
|
// IsReqRct := ((SqInfo^.MsgHdr.Attr and SqMsgRRQ) <> 0);
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseSquish.IsReqAud: Boolean; {Is current msg request audit}
|
//Function TMsgBaseSquish.IsReqAud: Boolean; {Is current msg request audit}
|
||||||
Begin
|
//Begin
|
||||||
IsReqAud := ((SqInfo^.MsgHdr.Attr and SqMsgArq) <> 0);
|
// IsReqAud := ((SqInfo^.MsgHdr.Attr and SqMsgArq) <> 0);
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseSquish.IsRetRct: Boolean; {Is current msg a return receipt}
|
//Function TMsgBaseSquish.IsRetRct: Boolean; {Is current msg a return receipt}
|
||||||
Begin
|
//Begin
|
||||||
IsRetRct := ((SqInfo^.MsgHdr.Attr and SqMsgCpt) <> 0);
|
// IsRetRct := ((SqInfo^.MsgHdr.Attr and SqMsgCpt) <> 0);
|
||||||
End;
|
//End;
|
||||||
|
|
||||||
Function TMsgBaseSquish.IsFileReq: Boolean; {Is current msg a file request}
|
Function TMsgBaseSquish.IsFileReq: Boolean; {Is current msg a file request}
|
||||||
Begin
|
Begin
|
||||||
|
|
Loading…
Reference in New Issue