Echomail patches and updates in main project. Keeping current with their changes.
This commit is contained in:
parent
13c6aa345b
commit
6176f77107
|
@ -15,7 +15,8 @@ Function strComma (Num: LongInt) : String;
|
||||||
Function strI2S (Num: LongInt) : String;
|
Function strI2S (Num: LongInt) : String;
|
||||||
Function strH2I (Str: String) : LongInt;
|
Function strH2I (Str: String) : LongInt;
|
||||||
Function strI2H (Num: LongInt; Idx: Byte) : String;
|
Function strI2H (Num: LongInt; Idx: Byte) : String;
|
||||||
Function strS2I (Str: String) : LongInt;
|
//Function strI2Base (Base: Byte; Num: Int64; Pad: Integer) : String;
|
||||||
|
Function strS2I (Str: String) : Int64;
|
||||||
Function strI2O (Num: LongInt) : String;
|
Function strI2O (Num: LongInt) : String;
|
||||||
Function strR2S (Num: Real; Deci: Byte) : String;
|
Function strR2S (Num: Real; Deci: Byte) : String;
|
||||||
Function strWordGet (Num: Byte; Str: String; Ch: Char) : String;
|
Function strWordGet (Num: Byte; Str: String; Ch: Char) : String;
|
||||||
|
@ -170,6 +171,23 @@ Begin
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
(*
|
||||||
|
Function strI2Base (Base: Byte; Num: Int64; Pad: Integer) : String;
|
||||||
|
Const
|
||||||
|
B36Codes = '0123456789abcdefghijklmnopqrstuvwxyz';
|
||||||
|
Begin
|
||||||
|
Result := '';
|
||||||
|
|
||||||
|
Repeat
|
||||||
|
Result := B36Codes[Num MOD Base + 1] + Result;
|
||||||
|
Num := Num DIV Base;
|
||||||
|
Until Num = 0;
|
||||||
|
|
||||||
|
If Pad > 0 Then
|
||||||
|
Result := strPadL(Result, Pad, '0');
|
||||||
|
End;
|
||||||
|
*)
|
||||||
|
|
||||||
Function strI2H (Num: LongInt; Idx: Byte) : String;
|
Function strI2H (Num: LongInt; Idx: Byte) : String;
|
||||||
Var
|
Var
|
||||||
Ch : Char;
|
Ch : Char;
|
||||||
|
@ -218,12 +236,13 @@ Begin
|
||||||
Str (Num:0:Deci, Result);
|
Str (Num:0:Deci, Result);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function strS2I (Str: String) : LongInt;
|
Function strS2I (Str: String) : Int64;
|
||||||
Var
|
Var
|
||||||
Res : LongInt;
|
Res : LongInt;
|
||||||
Temp : LongInt;
|
Temp : Int64;
|
||||||
Begin
|
Begin
|
||||||
Val (strStripB(Str, ' '), Temp, Res);
|
Val (strStripB(Str, ' '), Temp, Res);
|
||||||
|
|
||||||
If Res = 0 Then
|
If Res = 0 Then
|
||||||
Result := Temp
|
Result := Temp
|
||||||
Else
|
Else
|
||||||
|
|
|
@ -999,6 +999,7 @@ Begin
|
||||||
|
|
||||||
If Graphics = 0 Then Exit;
|
If Graphics = 0 Then Exit;
|
||||||
|
|
||||||
|
|
||||||
CurBG := (Console.TextAttr SHR 4) AND 7;
|
CurBG := (Console.TextAttr SHR 4) AND 7;
|
||||||
CurFG := Console.TextAttr AND $F;
|
CurFG := Console.TextAttr AND $F;
|
||||||
Prefix := '';
|
Prefix := '';
|
||||||
|
|
|
@ -35,12 +35,11 @@ Type
|
||||||
Destructor Destroy; Override;
|
Destructor Destroy; Override;
|
||||||
|
|
||||||
Function IsQuotedText (Str: String) : Boolean;
|
Function IsQuotedText (Str: String) : Boolean;
|
||||||
// Function OpenCreateBase (Var Msg: PMsgBaseABS; Var Area: RecMessageBase) : Boolean;
|
Procedure ExportQuoteData (Var Msg: PMsgBaseABS);
|
||||||
Procedure AppendMessageText (Var Msg: PMsgBaseABS; Lines: Integer; ReplyID: String);
|
Procedure AppendMessageText (Var Msg: PMsgBaseABS; Lines: Integer; ReplyID: String);
|
||||||
Procedure AssignMessageData (Var Msg: PMsgBaseABS; Var TempBase: RecMessageBase);
|
Procedure AssignMessageData (Var Msg: PMsgBaseABS; Var TempBase: RecMessageBase);
|
||||||
Function GetBaseByNum (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
Function GetBaseByNum (Num: LongInt; Var TempBase: RecMessageBase) : Boolean;
|
||||||
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 GetMessageStats (List, ShowPrompt, ShowYou: Boolean; Var ListPtr: LongInt; Var TempBase: RecMessageBase; NoFrom, NoRead: Boolean; Var Total, New, Yours: LongInt) : Boolean;
|
Function GetMessageStats (List, ShowPrompt, ShowYou: Boolean; Var ListPtr: LongInt; Var TempBase: RecMessageBase; NoFrom, NoRead: Boolean; Var Total, New, Yours: LongInt) : Boolean;
|
||||||
Procedure GetMailStats (Var Total, UnRead: LongInt);
|
Procedure GetMailStats (Var Total, UnRead: LongInt);
|
||||||
Function GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
|
Function GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
|
||||||
|
@ -80,8 +79,6 @@ Implementation
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
m_Strings,
|
m_Strings,
|
||||||
// BBS_Records,
|
|
||||||
// BBS_Common,
|
|
||||||
BBS_DataBase,
|
BBS_DataBase,
|
||||||
BBS_Core,
|
BBS_Core,
|
||||||
BBS_User,
|
BBS_User,
|
||||||
|
@ -133,6 +130,66 @@ Begin
|
||||||
Inherited Destroy;
|
Inherited Destroy;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Procedure TMsgBase.ExportQuoteData (Var Msg: PMsgBaseABS);
|
||||||
|
Var
|
||||||
|
QuoteFile : Text;
|
||||||
|
Initials : String[4];
|
||||||
|
TempStr : String;
|
||||||
|
WrapData : String;
|
||||||
|
DoWrap : Boolean = True;
|
||||||
|
Begin
|
||||||
|
Assign (QuoteFile, Session.TempPath + 'msgtmp');
|
||||||
|
|
||||||
|
{$I-} ReWrite (QuoteFile); {$I+}
|
||||||
|
|
||||||
|
If IoResult = 0 Then Begin
|
||||||
|
Initials := strInitials(MsgBase^.GetFrom) + '> ';
|
||||||
|
TempStr := Session.GetPrompt(464);
|
||||||
|
|
||||||
|
TempStr := strReplace(TempStr, '|&1', MsgBase^.GetDate);
|
||||||
|
TempStr := strReplace(TempStr, '|&2', MsgBase^.GetFrom);
|
||||||
|
TempStr := strReplace(TempStr, '|&3', Initials);
|
||||||
|
|
||||||
|
WriteLn (QuoteFile, TempStr);
|
||||||
|
WriteLn (QuoteFile, ' ');
|
||||||
|
|
||||||
|
MsgBase^.MsgTxtStartUp;
|
||||||
|
|
||||||
|
WrapData := '';
|
||||||
|
|
||||||
|
While Not MsgBase^.EOM Do Begin
|
||||||
|
TempStr := MsgBase^.GetString(79);
|
||||||
|
|
||||||
|
If TempStr[1] = #1 Then Continue;
|
||||||
|
|
||||||
|
DoWrap := Not IsQuotedText(TempStr);
|
||||||
|
|
||||||
|
If DoWrap Then Begin
|
||||||
|
If WrapData <> '' Then Begin
|
||||||
|
If TempStr = '' Then Begin
|
||||||
|
WriteLn (QuoteFile, ' ' + Initials + strStripB(WrapData, ' '));
|
||||||
|
WriteLn (QuoteFile, ' ' + Initials);
|
||||||
|
|
||||||
|
WrapData := '';
|
||||||
|
|
||||||
|
Continue;
|
||||||
|
End;
|
||||||
|
|
||||||
|
TempStr := strStripB(WrapData, ' ') + ' ' + strStripL(TempStr, ' ');
|
||||||
|
End;
|
||||||
|
|
||||||
|
strWrap (TempStr, WrapData, 74);
|
||||||
|
|
||||||
|
WriteLn (QuoteFile, ' ' + Initials + Copy(TempStr, 1, 75));
|
||||||
|
End Else
|
||||||
|
WriteLn (QuoteFile, ' ' + Initials + Copy(TempStr, 1, 75));
|
||||||
|
End;
|
||||||
|
|
||||||
|
Close (QuoteFile);
|
||||||
|
End;
|
||||||
|
|
||||||
|
End;
|
||||||
|
|
||||||
Function TMsgBase.GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
|
Function TMsgBase.GetMatchedAddress (Orig, Dest: RecEchoMailAddr) : RecEchoMailAddr;
|
||||||
Var
|
Var
|
||||||
Count : Byte;
|
Count : Byte;
|
||||||
|
@ -1248,10 +1305,6 @@ Var
|
||||||
Addr : RecEchomailAddr;
|
Addr : RecEchomailAddr;
|
||||||
MsgNew : PMsgBaseABS;
|
MsgNew : PMsgBaseABS;
|
||||||
TempStr : String;
|
TempStr : String;
|
||||||
Initials : String[4];
|
|
||||||
WrapData : String;
|
|
||||||
DoWrap : Boolean = True;
|
|
||||||
QuoteFile : Text;
|
|
||||||
Lines : SmallInt;
|
Lines : SmallInt;
|
||||||
Total : LongInt;
|
Total : LongInt;
|
||||||
ReplyBase : RecMessageBase;
|
ReplyBase : RecMessageBase;
|
||||||
|
@ -1372,54 +1425,7 @@ Begin
|
||||||
|
|
||||||
If Subj = '' Then Exit;
|
If Subj = '' Then Exit;
|
||||||
|
|
||||||
Assign (QuoteFile, Session.TempPath + 'msgtmp');
|
ExportQuoteData(MsgBase);
|
||||||
{$I-} ReWrite (QuoteFile); {$I+}
|
|
||||||
|
|
||||||
If IoResult = 0 Then Begin
|
|
||||||
Initials := strInitials(MsgBase^.GetFrom) + '> ';
|
|
||||||
TempStr := Session.GetPrompt(464);
|
|
||||||
|
|
||||||
TempStr := strReplace(TempStr, '|&1', MsgBase^.GetDate);
|
|
||||||
TempStr := strReplace(TempStr, '|&2', MsgBase^.GetFrom);
|
|
||||||
TempStr := strReplace(TempStr, '|&3', Initials);
|
|
||||||
|
|
||||||
WriteLn (QuoteFile, TempStr);
|
|
||||||
WriteLn (QuoteFile, ' ');
|
|
||||||
|
|
||||||
MsgBase^.MsgTxtStartUp;
|
|
||||||
|
|
||||||
WrapData := '';
|
|
||||||
|
|
||||||
While Not MsgBase^.EOM Do Begin
|
|
||||||
TempStr := MsgBase^.GetString(79);
|
|
||||||
|
|
||||||
If TempStr[1] = #1 Then Continue;
|
|
||||||
|
|
||||||
DoWrap := Not IsQuotedText(TempStr);
|
|
||||||
|
|
||||||
If DoWrap Then Begin
|
|
||||||
If WrapData <> '' Then Begin
|
|
||||||
If TempStr = '' Then Begin
|
|
||||||
WriteLn (QuoteFile, ' ' + Initials + strStripB(WrapData, ' '));
|
|
||||||
WriteLn (QuoteFile, ' ' + Initials);
|
|
||||||
|
|
||||||
WrapData := '';
|
|
||||||
|
|
||||||
Continue;
|
|
||||||
End;
|
|
||||||
|
|
||||||
TempStr := strStripB(WrapData, ' ') + ' ' + strStripL(TempStr, ' ');
|
|
||||||
End;
|
|
||||||
|
|
||||||
strWrap (TempStr, WrapData, 74);
|
|
||||||
|
|
||||||
WriteLn (QuoteFile, ' ' + Initials + Copy(TempStr, 1, 75));
|
|
||||||
End Else
|
|
||||||
WriteLn (QuoteFile, ' ' + Initials + Copy(TempStr, 1, 75));
|
|
||||||
End;
|
|
||||||
|
|
||||||
Close (QuoteFile);
|
|
||||||
End;
|
|
||||||
|
|
||||||
Lines := 0;
|
Lines := 0;
|
||||||
|
|
||||||
|
@ -1484,10 +1490,7 @@ End;
|
||||||
|
|
||||||
Procedure TMsgBase.EditMessage;
|
Procedure TMsgBase.EditMessage;
|
||||||
Var
|
Var
|
||||||
A : Integer;
|
Lines : Integer;
|
||||||
Lines : Integer;
|
|
||||||
Temp1 : String;
|
|
||||||
DestAddr : RecEchoMailAddr;
|
|
||||||
|
|
||||||
Procedure ReadText;
|
Procedure ReadText;
|
||||||
Begin
|
Begin
|
||||||
|
@ -1508,7 +1511,26 @@ Var
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Var
|
||||||
|
Count : LongInt;
|
||||||
|
TempStr : String;
|
||||||
|
DestAddr : RecEchoMailAddr;
|
||||||
Begin
|
Begin
|
||||||
|
If MsgBase^.GetRefer > 0 Then Begin
|
||||||
|
Count := MsgBase^.GetMsgNum;
|
||||||
|
|
||||||
|
MsgBase^.SeekFirst(MsgBase^.GetRefer);
|
||||||
|
|
||||||
|
If MsgBase^.SeekFound Then Begin
|
||||||
|
MsgBase^.MsgStartUp;
|
||||||
|
|
||||||
|
ExportQuoteData(MsgBase);
|
||||||
|
End;
|
||||||
|
|
||||||
|
MsgBase^.SeekFirst(Count);
|
||||||
|
MsgBase^.MsgStartUp;
|
||||||
|
End;
|
||||||
|
|
||||||
ReadText;
|
ReadText;
|
||||||
|
|
||||||
Repeat
|
Repeat
|
||||||
|
@ -1529,20 +1551,20 @@ Begin
|
||||||
Session.io.OutFull (Session.GetPrompt(297));
|
Session.io.OutFull (Session.GetPrompt(297));
|
||||||
|
|
||||||
If MBase.NetType = 3 Then Begin
|
If MBase.NetType = 3 Then Begin
|
||||||
Temp1 := Session.io.GetInput(30, 30, 11, MsgBase^.GetTo);
|
TempStr := Session.io.GetInput(30, 30, 11, MsgBase^.GetTo);
|
||||||
|
|
||||||
Session.io.OutFull (Session.GetPrompt(298));
|
Session.io.OutFull (Session.GetPrompt(298));
|
||||||
|
|
||||||
If Str2Addr(Session.io.GetInput(20, 20, 12, Addr2Str(DestAddr)), DestAddr) Then Begin
|
If Str2Addr(Session.io.GetInput(20, 20, 12, Addr2Str(DestAddr)), DestAddr) Then Begin
|
||||||
MsgBase^.SetTo(Temp1);
|
MsgBase^.SetTo(TempStr);
|
||||||
MsgBase^.SetDest(DestAddr)
|
MsgBase^.SetDest(DestAddr)
|
||||||
End;
|
End;
|
||||||
End Else
|
End Else
|
||||||
If MBase.Flags And MBPrivate <> 0 Then Begin
|
If MBase.Flags And MBPrivate <> 0 Then Begin
|
||||||
Temp1 := Session.io.GetInput (30, 30, 11, MsgBase^.GetTo);
|
TempStr := Session.io.GetInput (30, 30, 11, MsgBase^.GetTo);
|
||||||
|
|
||||||
If Session.User.SearchUser(Temp1, MBase.Flags and MBRealNames <> 0) Then
|
If Session.User.SearchUser(TempStr, MBase.Flags and MBRealNames <> 0) Then
|
||||||
MsgBase^.SetTo(Temp1);
|
MsgBase^.SetTo(TempStr);
|
||||||
End Else
|
End Else
|
||||||
MsgBase^.SetTo(Session.io.GetInput(30, 30, 11, MsgBase^.GetTo));
|
MsgBase^.SetTo(Session.io.GetInput(30, 30, 11, MsgBase^.GetTo));
|
||||||
End;
|
End;
|
||||||
|
@ -1553,10 +1575,10 @@ Begin
|
||||||
End;
|
End;
|
||||||
'C' : MsgBase^.SetSent(NOT MsgBase^.IsSent);
|
'C' : MsgBase^.SetSent(NOT MsgBase^.IsSent);
|
||||||
'!' : Begin
|
'!' : Begin
|
||||||
Temp1 := MsgBase^.GetSubj;
|
TempStr := MsgBase^.GetSubj;
|
||||||
|
|
||||||
If Editor(Lines, ColumnValue[Session.Theme.ColumnSize] - 2, mysMaxMsgLines, False, fn_tplMsgEdit, Temp1) Then
|
If Editor(Lines, ColumnValue[Session.Theme.ColumnSize] - 2, mysMaxMsgLines, False, fn_tplMsgEdit, TempStr) Then
|
||||||
MsgBase^.SetSubj(Temp1)
|
MsgBase^.SetSubj(TempStr)
|
||||||
Else
|
Else
|
||||||
ReadText;
|
ReadText;
|
||||||
End;
|
End;
|
||||||
|
@ -1564,8 +1586,8 @@ Begin
|
||||||
If Session.io.GetYN(Session.GetPrompt(300), True) Then Begin
|
If Session.io.GetYN(Session.GetPrompt(300), True) Then Begin
|
||||||
MsgBase^.EditMsgInit;
|
MsgBase^.EditMsgInit;
|
||||||
|
|
||||||
For A := 1 to Lines Do
|
For Count := 1 to Lines Do
|
||||||
MsgBase^.DoStringLn(MsgText[A]);
|
MsgBase^.DoStringLn(MsgText[Count]);
|
||||||
|
|
||||||
MsgBase^.EditMsgSave;
|
MsgBase^.EditMsgSave;
|
||||||
End;
|
End;
|
||||||
|
@ -1574,6 +1596,8 @@ Begin
|
||||||
|
|
||||||
End;
|
End;
|
||||||
Until False;
|
Until False;
|
||||||
|
|
||||||
|
DirClean (Session.TempPath, '');
|
||||||
End;
|
End;
|
||||||
|
|
||||||
(*
|
(*
|
||||||
|
|
|
@ -74,10 +74,10 @@ Var
|
||||||
Begin
|
Begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
writeln ('debug checking exists ', str, ' files:', ftp.responsedata.count);
|
// writeln ('debug checking exists ', str, ' files:', ftp.responsedata.count);
|
||||||
|
|
||||||
For Count := 1 to FTP.ResponseData.Count Do Begin
|
For Count := 1 to FTP.ResponseData.Count Do Begin
|
||||||
writeln('debug remote: ', FTP.ResponseData.Strings[Count - 1]);
|
// writeln('debug remote: ', FTP.ResponseData.Strings[Count - 1]);
|
||||||
|
|
||||||
If strUpper(JustFile(Str)) = strUpper(FTP.ResponseData.Strings[Count - 1]) Then Begin
|
If strUpper(JustFile(Str)) = strUpper(FTP.ResponseData.Strings[Count - 1]) Then Begin
|
||||||
Result := True;
|
Result := True;
|
||||||
|
|
|
@ -969,6 +969,7 @@ Begin
|
||||||
BinkP := TBinkP.Create (Server, Client, Queue, False, bbsCfg.inetBINKPTimeOut);
|
BinkP := TBinkP.Create (Server, Client, Queue, False, bbsCfg.inetBINKPTimeOut);
|
||||||
|
|
||||||
BinkP.StatusUpdate := @Status;
|
BinkP.StatusUpdate := @Status;
|
||||||
|
BinkP.ForceMD5 := bbsCfg.inetBINKPCram5;
|
||||||
|
|
||||||
If BinkP.DoAuthentication Then Begin
|
If BinkP.DoAuthentication Then Begin
|
||||||
|
|
||||||
|
@ -983,8 +984,8 @@ Begin
|
||||||
Server.Status (ProcessID, 'Queued ' + strI2S(Queue.QSize - Before) + ' files for ' + Addr2Str(BinkP.EchoNode.Address));
|
Server.Status (ProcessID, 'Queued ' + strI2S(Queue.QSize - Before) + ' files for ' + Addr2Str(BinkP.EchoNode.Address));
|
||||||
|
|
||||||
BinkP.SetBlockSize := BinkP.EchoNode.binkBlock;
|
BinkP.SetBlockSize := BinkP.EchoNode.binkBlock;
|
||||||
BinkP.UseMD5 := BinkP.EchoNode.binkMD5 > 0;
|
// BinkP.UseMD5 := BinkP.EchoNode.binkMD5 > 0;
|
||||||
BinkP.ForceMD5 := BinkP.EchoNode.binkMD5 = 2;
|
// BinkP.ForceMD5 := BinkP.EchoNode.binkMD5 = 2;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ Type
|
||||||
Cost : System.Word;
|
Cost : System.Word;
|
||||||
DateTime : String[19];
|
DateTime : String[19];
|
||||||
End;
|
End;
|
||||||
|
(*
|
||||||
RecPKTHeader = Record
|
RecPKTHeader = Record
|
||||||
OrigNode : System.Word;
|
OrigNode : System.Word;
|
||||||
DestNode : System.Word;
|
DestNode : System.Word;
|
||||||
|
@ -88,6 +88,36 @@ Type
|
||||||
DestZone : System.Word;
|
DestZone : System.Word;
|
||||||
Filler : Array[1..20] of Char;
|
Filler : Array[1..20] of Char;
|
||||||
End;
|
End;
|
||||||
|
*)
|
||||||
|
|
||||||
|
RecPKTHeader = Record
|
||||||
|
OrigNode : System.Word;
|
||||||
|
DestNode : System.Word;
|
||||||
|
Year : System.Word;
|
||||||
|
Month : System.Word;
|
||||||
|
Day : System.Word;
|
||||||
|
Hour : System.Word;
|
||||||
|
Minute : System.Word;
|
||||||
|
Second : System.Word;
|
||||||
|
Baud : System.Word;
|
||||||
|
PKTType : System.Word;
|
||||||
|
OrigNet : System.Word;
|
||||||
|
DestNet : System.Word;
|
||||||
|
ProdCode : Byte;
|
||||||
|
ProdRev : Byte;
|
||||||
|
Password : Array[1..8] of Char;
|
||||||
|
OrigZone : System.Word;
|
||||||
|
DestZone : System.Word;
|
||||||
|
Filler : Array[1..4] of Char;
|
||||||
|
ProdCode2 : Byte;
|
||||||
|
ProdRev2 : Byte;
|
||||||
|
Compat : System.Word;
|
||||||
|
OrigZone2 : System.Word;
|
||||||
|
DestZone2 : System.Word;
|
||||||
|
OrigPoint : System.Word;
|
||||||
|
DestPoint : System.Word;
|
||||||
|
ProdData : LongInt;
|
||||||
|
End;
|
||||||
|
|
||||||
RecMsgLine = String[79];
|
RecMsgLine = String[79];
|
||||||
|
|
||||||
|
@ -121,8 +151,29 @@ Type
|
||||||
Function GetMessage : Boolean;
|
Function GetMessage : Boolean;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
TPKTWriter = Class
|
||||||
|
MsgFile : TFileBuffer;
|
||||||
|
|
||||||
|
Constructor Create;
|
||||||
|
Destructor Destroy; Override;
|
||||||
|
End;
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
|
Constructor TPKTWriter.Create;
|
||||||
|
Begin
|
||||||
|
Inherited Create;
|
||||||
|
|
||||||
|
MsgFile := TFileBuffer.Create(8 * 1024);
|
||||||
|
End;
|
||||||
|
|
||||||
|
Destructor TPKTWriter.Destroy;
|
||||||
|
Begin
|
||||||
|
MsgFile.Free;
|
||||||
|
|
||||||
|
Inherited Destroy;
|
||||||
|
End;
|
||||||
|
|
||||||
Constructor TPKTDupe.Create (Max: Cardinal);
|
Constructor TPKTDupe.Create (Max: Cardinal);
|
||||||
Var
|
Var
|
||||||
F : File;
|
F : File;
|
||||||
|
@ -240,14 +291,16 @@ Begin
|
||||||
|
|
||||||
Opened := False;
|
Opened := False;
|
||||||
End Else Begin
|
End Else Begin
|
||||||
PKTOrig.Zone := PKTHeader.OrigZone;
|
PKTOrig.Zone := PKTHeader.OrigZone;
|
||||||
PKTOrig.Net := PKTHeader.OrigNet;
|
PKTOrig.Net := PKTHeader.OrigNet;
|
||||||
PKTOrig.Node := PKTHeader.OrigNode;
|
PKTOrig.Node := PKTHeader.OrigNode;
|
||||||
PKTDest.Zone := PKTHeader.DestZone;
|
PKTOrig.Point := PKTHeader.OrigPoint; //V2+
|
||||||
PKTDest.Net := PKTHeader.DestNet;
|
PKTDest.Zone := PKTHeader.DestZone;
|
||||||
PKTDest.Node := PKTHeader.DestNode;
|
PKTDest.Net := PKTHeader.DestNet;
|
||||||
Result := True;
|
PKTDest.Node := PKTHeader.DestNode;
|
||||||
Opened := True;
|
PKTDest.Point := PKTHeader.DestPoint; //V2+
|
||||||
|
Result := True;
|
||||||
|
Opened := True;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -302,7 +355,6 @@ Begin
|
||||||
DisposeText;
|
DisposeText;
|
||||||
|
|
||||||
First := True;
|
First := True;
|
||||||
// IsNetmail := False;
|
|
||||||
MsgSize := 0;
|
MsgSize := 0;
|
||||||
Result := True;
|
Result := True;
|
||||||
MsgLines := 1;
|
MsgLines := 1;
|
||||||
|
|
|
@ -52,6 +52,7 @@ Begin
|
||||||
Close (T);
|
Close (T);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
(*
|
||||||
Procedure BundleMessages;
|
Procedure BundleMessages;
|
||||||
Var
|
Var
|
||||||
F : File;
|
F : File;
|
||||||
|
@ -130,6 +131,90 @@ Begin
|
||||||
|
|
||||||
FindClose (DirInfo);
|
FindClose (DirInfo);
|
||||||
End;
|
End;
|
||||||
|
*)
|
||||||
|
|
||||||
|
Procedure BundleMessages;
|
||||||
|
Var
|
||||||
|
F : File;
|
||||||
|
PH : RecPKTHeader;
|
||||||
|
DirInfo : SearchRec;
|
||||||
|
NodeIndex : LongInt;
|
||||||
|
EchoNode : RecEchoMailNode;
|
||||||
|
PKTName : String;
|
||||||
|
BundleName : String;
|
||||||
|
BundlePath : String;
|
||||||
|
BundleSize : Cardinal;
|
||||||
|
Temp : String;
|
||||||
|
FLOName : String;
|
||||||
|
OrigAddr : RecEchoMailAddr;
|
||||||
|
CheckInc : Boolean;
|
||||||
|
Begin
|
||||||
|
FindFirst (TempPath + '*', AnyFile, DirInfo);
|
||||||
|
|
||||||
|
While DosError = 0 Do Begin
|
||||||
|
If DirInfo.Attr AND Directory = 0 Then Begin
|
||||||
|
NodeIndex := strS2I(JustFileExt(DirInfo.Name));
|
||||||
|
PKTName := JustFileName(DirInfo.Name) + '.pkt';
|
||||||
|
|
||||||
|
GetNodeByIndex (NodeIndex, EchoNode);
|
||||||
|
FileReName (TempPath + DirInfo.Name, TempPath + PKTName);
|
||||||
|
|
||||||
|
Assign (F, TempPath + PKTName);
|
||||||
|
Reset (F, 1);
|
||||||
|
BlockRead (F, PH, SizeOf(PH));
|
||||||
|
Close (F);
|
||||||
|
|
||||||
|
OrigAddr.Zone := PH.OrigZone;
|
||||||
|
OrigAddr.Net := PH.OrigNet;
|
||||||
|
OrigAddr.Node := PH.OrigNode;
|
||||||
|
|
||||||
|
BundlePath := GetFTNOutPath(EchoNode);
|
||||||
|
FLOName := BundlePath + GetFTNFlowName(EchoNode.Address);
|
||||||
|
CheckInc := False;
|
||||||
|
|
||||||
|
DirCreate (BundlePath);
|
||||||
|
|
||||||
|
Case EchoNode.MailType of
|
||||||
|
0 : FLOName := FLOName + '.flo';
|
||||||
|
1 : FLOName := FLOName + '.clo';
|
||||||
|
2 : FLOName := FLOName + '.dlo';
|
||||||
|
3 : FLOName := FLOName + '.hlo';
|
||||||
|
End;
|
||||||
|
|
||||||
|
If EchoNode.ArcType = '' Then Begin
|
||||||
|
FileReName (TempPath + PKTName, BundlePath + PKTName);
|
||||||
|
AddToFLOQueue (FLOName, BundlePath + PKTName);
|
||||||
|
End Else Begin
|
||||||
|
If Not (EchoNode.LPKTPtr in [48..57, 97..122]) Then
|
||||||
|
EchoNode.LPKTPtr := 48;
|
||||||
|
|
||||||
|
If EchoNode.LPKTDay <> DayOfWeek(CurDateDos) Then Begin
|
||||||
|
EchoNode.LPKTDay := DayOfWeek(CurDateDos);
|
||||||
|
EchoNode.LPKTPtr := 48;
|
||||||
|
End Else
|
||||||
|
CheckInc := True;
|
||||||
|
|
||||||
|
BundleName := BundlePath + GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + Copy(strLower(DayString[DayOfWeek(CurDateDos)]), 1, 2) + Char(EchoNode.LPKTPtr);
|
||||||
|
|
||||||
|
If CheckInc And Not FileExist(BundleName) Then Begin
|
||||||
|
BundleName := GetFTNBundleExt(True, BundleName);
|
||||||
|
|
||||||
|
EchoNode.LPKTPtr := Byte(BundleName[Length(BundleName)]);
|
||||||
|
End;
|
||||||
|
|
||||||
|
SaveEchoMailNode(EchoNode);
|
||||||
|
|
||||||
|
ExecuteArchive (TempPath, BundleName, EchoNode.ArcType, TempPath + PKTName, 1);
|
||||||
|
FileErase (TempPath + PKTName);
|
||||||
|
AddToFLOQueue (FLOName, BundleName);
|
||||||
|
End;
|
||||||
|
End;
|
||||||
|
|
||||||
|
FindNext (DirInfo);
|
||||||
|
End;
|
||||||
|
|
||||||
|
FindClose (DirInfo);
|
||||||
|
End;
|
||||||
|
|
||||||
Procedure uEchoExport;
|
Procedure uEchoExport;
|
||||||
Var
|
Var
|
||||||
|
@ -231,22 +316,29 @@ Var
|
||||||
|
|
||||||
FillChar (PH, SizeOf(PH), 0);
|
FillChar (PH, SizeOf(PH), 0);
|
||||||
|
|
||||||
PH.OrigZone := MsgBase^.GetOrigAddr.Zone;
|
PH.OrigZone := MsgBase^.GetOrigAddr.Zone;
|
||||||
PH.OrigNet := MsgBase^.GetOrigAddr.Net;
|
PH.OrigNet := MsgBase^.GetOrigAddr.Net;
|
||||||
PH.OrigNode := MsgBase^.GetOrigAddr.Node;
|
PH.OrigNode := MsgBase^.GetOrigAddr.Node;
|
||||||
PH.DestZone := EchoNode.Address.Zone;
|
PH.OrigPoint := MsgBase^.GetOrigAddr.Point;
|
||||||
PH.DestNet := EchoNode.Address.Net;
|
PH.DestZone := EchoNode.Address.Zone;
|
||||||
PH.DestNode := EchoNode.Address.Node;
|
PH.DestNet := EchoNode.Address.Net;
|
||||||
// ^^ does this need to change for netmail too?
|
PH.DestNode := EchoNode.Address.Node;
|
||||||
PH.Year := DT.Year;
|
PH.DestPoint := EchoNode.Address.Point;
|
||||||
PH.Month := DT.Month;
|
PH.Year := DT.Year;
|
||||||
PH.Day := DT.Day;
|
PH.Month := DT.Month;
|
||||||
PH.Hour := DT.Hour;
|
PH.Day := DT.Day;
|
||||||
PH.Minute := DT.Min;
|
PH.Hour := DT.Hour;
|
||||||
PH.Second := DT.Sec;
|
PH.Minute := DT.Min;
|
||||||
PH.PKTType := 2;
|
PH.Second := DT.Sec;
|
||||||
PH.ProdCode := 254; // RESEARCH THIS
|
PH.PKTType := 2;
|
||||||
//Password : Array[1..8] of Char; // RESEARCH THIS
|
PH.ProdCode := 254;
|
||||||
|
|
||||||
|
// Map current V2 values to V2+ values
|
||||||
|
|
||||||
|
PH.ProdCode2 := PH.ProdCode;
|
||||||
|
PH.OrigZone2 := PH.OrigZone;
|
||||||
|
PH.DestZone2 := PH.DestZone;
|
||||||
|
PH.Compat := $0000000000000001;
|
||||||
|
|
||||||
BlockWrite (F, PH, SizeOf(PH));
|
BlockWrite (F, PH, SizeOf(PH));
|
||||||
End;
|
End;
|
||||||
|
|
|
@ -79,6 +79,8 @@ Var
|
||||||
Status : LongInt;
|
Status : LongInt;
|
||||||
ForwardList : Array[1..50] of String[35];
|
ForwardList : Array[1..50] of String[35];
|
||||||
ForwardSize : Byte = 0;
|
ForwardSize : Byte = 0;
|
||||||
|
//TwitList : Array[1..50] of String[35];
|
||||||
|
//TwitSize : Byte = 0;
|
||||||
|
|
||||||
Procedure ImportPacketFile (PktFN: String);
|
Procedure ImportPacketFile (PktFN: String);
|
||||||
Var
|
Var
|
||||||
|
@ -285,16 +287,13 @@ Var
|
||||||
|
|
||||||
Procedure ImportPacketBundle (PktBundle: String);
|
Procedure ImportPacketBundle (PktBundle: String);
|
||||||
Var
|
Var
|
||||||
PKTMatched : Boolean;
|
|
||||||
DirInfo : SearchRec;
|
DirInfo : SearchRec;
|
||||||
NodeFile : File of RecEchoMailNode;
|
NodeFile : File of RecEchoMailNode;
|
||||||
EchoNode : RecEchoMailNode;
|
EchoNode : RecEchoMailNode;
|
||||||
ArcType : String[4];
|
ArcType : String[4] = '';
|
||||||
Count : LongInt;
|
Count : LongInt;
|
||||||
BundleList : TStringList;
|
BundleList : TStringList;
|
||||||
Begin
|
Begin
|
||||||
PKTMatched := False;
|
|
||||||
|
|
||||||
Assign (NodeFile, bbsCfg.DataPath + 'echonode.dat');
|
Assign (NodeFile, bbsCfg.DataPath + 'echonode.dat');
|
||||||
|
|
||||||
If ioReset(NodeFile, Sizeof(RecEchoMailNode), fmRWDN) Then Begin
|
If ioReset(NodeFile, Sizeof(RecEchoMailNode), fmRWDN) Then Begin
|
||||||
|
@ -303,8 +302,7 @@ Var
|
||||||
|
|
||||||
For Count := 1 to 30 Do Begin
|
For Count := 1 to 30 Do Begin
|
||||||
If strUpper(JustFileName(PktBundle)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsCfg.NetAddress[Count])) Then Begin
|
If strUpper(JustFileName(PktBundle)) = strUpper(GetFTNArchiveName(EchoNode.Address, bbsCfg.NetAddress[Count])) Then Begin
|
||||||
PKTMatched := True;
|
ArcType := EchoNode.ArcType;
|
||||||
ArcType := EchoNode.ArcType;
|
|
||||||
|
|
||||||
Break;
|
Break;
|
||||||
End;
|
End;
|
||||||
|
@ -314,7 +312,7 @@ Var
|
||||||
Close (NodeFile);
|
Close (NodeFile);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
If Not PKTMatched Then Begin
|
If ArcType = '' Then Begin
|
||||||
Case GetArchiveType(bbsCfg.InboundPath + PktBundle) of
|
Case GetArchiveType(bbsCfg.InboundPath + PktBundle) of
|
||||||
'A' : ArcType := 'ARJ';
|
'A' : ArcType := 'ARJ';
|
||||||
'R' : ArcType := 'RAR';
|
'R' : ArcType := 'RAR';
|
||||||
|
@ -405,6 +403,22 @@ Begin
|
||||||
ForwardList[ForwardSize] := strStripB(FileExt, ' ');
|
ForwardList[ForwardSize] := strStripB(FileExt, ' ');
|
||||||
Until ForwardSize = 50;
|
Until ForwardSize = 50;
|
||||||
|
|
||||||
|
(* global blacklist.txt and/or revamp of -mtrash and trashcan.txt
|
||||||
|
FillChar (TwitList, SizeOf(TwitList), #0);
|
||||||
|
|
||||||
|
Ini.SetSequential(True);
|
||||||
|
|
||||||
|
Repeat
|
||||||
|
FileExt := INI.ReadString(Header_ECHOIMPORT, 'twit', '');
|
||||||
|
|
||||||
|
If FileExt = '' Then Break;
|
||||||
|
|
||||||
|
Inc (TwitSize);
|
||||||
|
|
||||||
|
TwitList[TwitSize] := strStripB(FileExt, ' ');
|
||||||
|
Until TwitSize = 50;
|
||||||
|
*)
|
||||||
|
|
||||||
INI.SetSequential(False);
|
INI.SetSequential(False);
|
||||||
|
|
||||||
Dupes := TPKTDupe.Create(Count);
|
Dupes := TPKTDupe.Create(Count);
|
||||||
|
|
Loading…
Reference in New Issue