Code cleanup

This commit is contained in:
mysticbbs 2012-09-24 02:38:25 -04:00
parent b788a94a0e
commit 0087df705f
4 changed files with 129 additions and 177 deletions

View File

@ -1464,10 +1464,7 @@ Var
End;
Procedure Send_Msg_Text (Str : String);
Var
B : Byte;
Begin
If IsQuotedText(Str) Then Begin
Session.io.AnsiColor(MBase.ColQuote);
Session.io.OutPipe (Str);

View File

@ -62,7 +62,7 @@ Type
Function GetFrom: String; Virtual; {Get from name on current msg}
Function GetTo: String; Virtual; {Get to name on current msg}
Function GetSubj: String; Virtual; {Get subject on current msg}
Function GetCost: Word; Virtual; {Get cost of current msg}
// Function GetCost: Word; Virtual; {Get cost of current msg}
Function GetDate: String; Virtual; {Get date of current msg}
Function GetTime: String; Virtual; {Get time of current msg}
Function GetRefer: LongInt; Virtual; {Get reply to of current msg}
@ -381,9 +381,9 @@ Function TMsgBaseABS.GetSubj: String;
Begin
End;
Function TMsgBaseABS.GetCost: Word;
Begin
End;
//Function TMsgBaseABS.GetCost: Word;
//Begin
//End;
Function TMsgBaseABS.GetDate: String;
Begin

View File

@ -191,7 +191,7 @@ Type
Function GetFrom : String; Virtual; {Get from name on current msg}
Function GetTo : String; Virtual; {Get to name on current msg}
Function GetSubj : String; Virtual; {Get subject on current msg}
Function GetCost : Word; Virtual; {Get cost of current msg}
// Function GetCost : Word; Virtual; {Get cost of current msg}
Function GetDate : String; Virtual; {Get date of current msg}
Function GetTime : String; Virtual; {Get time of current msg}
Function GetRefer : LongInt; Virtual; {Get reply to of current msg}
@ -307,79 +307,66 @@ Begin
JamStrCrc := Crc;
End;
Procedure TMsgBaseJAM.SetMsgPath(St: String);
Begin
JM^.MsgPath := Copy(St, 1, 124);
End;
Function TMsgBaseJAM.GetHighMsgNum: LongInt;
Begin
GetHighMsgNum := JM^.BaseHdr.BaseMsgNum + FileSize(JM^.IdxFile) - 1;
End;
Procedure TMsgBaseJAM.SetDest(Var Addr: RecEchoMailAddr);
Begin
JM^.Dest := Addr;
End;
Procedure TMsgBaseJAM.SetOrig(Var Addr: RecEchoMailAddr);
Begin
JM^.Orig := Addr;
End;
Procedure TMsgBaseJAM.SetFrom(Name: String);
Begin
JM^.MsgFrom := Name;
End;
Procedure TMsgBaseJAM.SetTo(Name: String);
Begin
JM^.MsgTo := Name;
End;
Procedure TMsgBaseJAM.SetSubj(Str: String);
Begin
JM^.MsgSubj := Str;
End;
Procedure TMsgBaseJAM.SetCost(SCost: Word);
Begin
MsgHdr^.JamHdr.Cost := SCost;
End;
Procedure TMsgBaseJAM.SetRefer(SRefer: LongInt);
Begin
MsgHdr^.JamHdr.ReplyTo := SRefer;
End;
Procedure TMsgBaseJAM.SetSeeAlso(SAlso: LongInt);
Begin
MsgHdr^.JamHdr.ReplyFirst := SAlso;
End;
Procedure TMsgBaseJAM.SetDate(SDate: String);
Begin
JM^.MsgDate := SDate;
End;
Procedure TMsgBaseJAM.SetTime(STime: String);
Begin
JM^.MsgTime := STime;
End;
Procedure TMsgBaseJAM.SetAttr1(Mask: LongInt; St: Boolean);
Begin
If St Then
@ -548,9 +535,10 @@ Type
Begin
SubField := SubFieldPTR(@MsgHdr^.SubBuf[MsgHdr^.JamHdr.SubFieldLen + 1]);
If (MsgHdr^.JamHdr.SubFieldLen + 8 + Length(Data) < JamSubBufSize) Then
Begin
If (MsgHdr^.JamHdr.SubFieldLen + 8 + Length(Data) < JamSubBufSize) Then Begin
Inc(MsgHdr^.JamHdr.SubFieldLen, 8 + Length(Data));
SubField^.LoId := Id;
SubField^.HiId := 0;
SubField^.DataLen := Length(Data);
@ -741,7 +729,6 @@ Function TMsgBaseJAM.WriteMsg: Word;
WriteError: Word;
i: longint;
TmpIdx: JamIdxType;
Begin
WriteError := 0;
@ -952,8 +939,7 @@ Procedure TMsgBaseJAM.MsgStartUp;
JM^.MsgTime := strZero(DT.Hour) + ':' + strZero(DT.Min);
SubCtr := 1;
While ((SubCtr <= MsgHdr^.JamHdr.SubFieldLen) and
(SubCtr < JamSubBufSize)) Do
While ((SubCtr <= MsgHdr^.JamHdr.SubFieldLen) and (SubCtr < JamSubBufSize)) Do
Begin
SubPtr := SubFieldPTR(@MsgHdr^.SubBuf[SubCtr]);
Inc(SubCtr, SubPtr^.DataLen + 8);
@ -1101,21 +1087,18 @@ Function TMsgBaseJAM.GetString(MaxLen: Word): String;
WPos : LongInt;
WLen : Byte;
StrDone : Boolean;
// TxtOver: Boolean;
StartSoft : Boolean;
CurrLen : Word;
// PPos: LongInt;
TmpCh : Char;
Begin
StrDone := False;
CurrLen := 0;
// PPos := JM^.TxtPos;
WPos := 0;
WLen := 0;
StartSoft := LastSoft;
LastSoft := True;
TmpCh := GetChar;
While ((Not StrDone) And (CurrLen <= MaxLen) And (Not EOM)) Do Begin
Case TmpCh of
#$00: ;
@ -1126,50 +1109,39 @@ Function TMsgBaseJAM.GetString(MaxLen: Word): String;
#$8d: ;
#$0a: ;
#$20: Begin
If ((CurrLen <> 0) or (Not StartSoft)) Then
Begin
If ((CurrLen <> 0) or (Not StartSoft)) Then Begin
Inc(CurrLen);
WLen := CurrLen;
GetString[CurrLen] := TmpCh;
WPos := JM^.TxtPos;
End
Else
End Else
StartSoft := False;
End;
Else
Begin
Inc(CurrLen);
GetString[CurrLen] := TmpCh;
End;
End;
If Not StrDone Then
TmpCh := GetChar;
End;
If StrDone Then
Begin
If StrDone Then Begin
GetString[0] := Chr(CurrLen);
End
Else
If EOM Then
Begin
End Else
If EOM Then Begin
GetString[0] := Chr(CurrLen);
End
Else
Begin
If WLen = 0 Then
Begin
End Else Begin
If WLen = 0 Then Begin
GetString[0] := Chr(CurrLen);
Dec(JM^.TxtPos);
End
Else
Begin
End Else Begin
GetString[0] := Chr(WLen);
JM^.TxtPos := WPos;
End;
End;
End;
Function TMsgBaseJAM.EOM: Boolean;
Begin
EOM := (((JM^.TxtPos < MsgHdr^.JamHdr.TextOfs) Or
@ -1188,61 +1160,51 @@ Function TMsgBaseJAM.GetFrom: String; {Get from name on current msg}
GetFrom := JM^.MsgFrom;
End;
Function TMsgBaseJAM.GetTo: String; {Get to name on current msg}
Begin
GetTo := JM^.MsgTo;
End;
Function TMsgBaseJAM.GetSubj: String; {Get subject on current msg}
Begin
GetSubj := JM^.MsgSubj;
End;
Function TMsgBaseJAM.GetCost: Word; {Get cost of current msg}
Begin
GetCost := MsgHdr^.JamHdr.Cost;
End;
//Function TMsgBaseJAM.GetCost: Word; {Get cost of current msg}
//Begin
// GetCost := MsgHdr^.JamHdr.Cost;
//End;
Function TMsgBaseJAM.GetDate: String; {Get date of current msg}
Begin
GetDate := JM^.MsgDate;
End;
Function TMsgBaseJAM.GetTime: String; {Get time of current msg}
Begin
GetTime := JM^.MsgTime;
End;
Function TMsgBaseJAM.GetRefer: LongInt; {Get reply to of current msg}
Begin
GetRefer := MsgHdr^.JamHdr.ReplyTo;
End;
Function TMsgBaseJAM.GetSeeAlso: LongInt; {Get see also of current msg}
Begin
GetSeeAlso := MsgHdr^.JamHdr.ReplyFirst;
End;
Function TMsgBaseJAM.GetMsgNum: LongInt; {Get message number}
Begin
GetMsgNum := MsgHdr^.JamHdr.MsgNum;
End;
Procedure TMsgBaseJAM.GetOrig(Var Addr: RecEchoMailAddr); {Get origin address}
Begin
Addr := JM^.Orig;
End;
Procedure TMsgBaseJAM.GetDest(Var Addr: RecEchoMailAddr); {Get destination address}
Begin
Addr := JM^.Dest;
@ -1258,25 +1220,21 @@ Function TMsgBaseJAM.IsLocal: Boolean; {Is current msg local}
IsLocal := (MsgHdr^.JamHdr.Attr1 and Jam_Local) <> 0;
End;
Function TMsgBaseJAM.IsCrash: Boolean; {Is current msg crash}
Begin
IsCrash := (MsgHdr^.JamHdr.Attr1 and Jam_Crash) <> 0;
End;
Function TMsgBaseJAM.IsKillSent: Boolean; {Is current msg kill sent}
Begin
IsKillSent := (MsgHdr^.JamHdr.Attr1 and Jam_KillSent) <> 0;
End;
Function TMsgBaseJAM.IsSent: Boolean; {Is current msg sent}
Begin
IsSent := (MsgHdr^.JamHdr.Attr1 and Jam_Sent) <> 0;
End;
Function TMsgBaseJAM.IsFAttach: Boolean; {Is current msg file attach}
Begin
IsFAttach := (MsgHdr^.JamHdr.Attr1 and Jam_FAttch) <> 0;
@ -1300,7 +1258,6 @@ Function TMsgBaseJAM.IsFAttach: Boolean; {Is current msg file attach}
// IsRetRct := False;
// End;
Function TMsgBaseJAM.IsFileReq: Boolean; {Is current msg a file request}
Begin
IsFileReq := (MsgHdr^.JamHdr.Attr1 and Jam_Freq) <> 0;
@ -1312,13 +1269,11 @@ Function TMsgBaseJAM.IsRcvd: Boolean; {Is current msg received}
IsRcvd := (MsgHdr^.JamHdr.Attr1 and Jam_Rcvd) <> 0;
End;
Function TMsgBaseJAM.IsPriv: Boolean; {Is current msg priviledged/private}
Begin
IsPriv := (MsgHdr^.JamHdr.Attr1 and Jam_Priv) <> 0;
End;
Function TMsgBaseJAM.IsDeleted: Boolean; {Is current msg deleted}
Begin
IsDeleted := (MsgHdr^.JamHdr.Attr1 and Jam_Deleted) <> 0;

View File

@ -16,8 +16,8 @@ Const
SqNullFrame = 0;
SqFrameMsg = 0;
SqFrameFree = 1;
SqFrameRLE = 2;
SqFrameLZW = 3;
// SqFrameRLE = 2;
// SqFrameLZW = 3;
SqFromSize = 36;
SqToSize = 36;
SqSubjSize = 72;