diff --git a/mystic/bbs_database.pas b/mystic/bbs_database.pas index 90f4709..640e081 100644 --- a/mystic/bbs_database.pas +++ b/mystic/bbs_database.pas @@ -92,22 +92,27 @@ Begin Result := Temp; End; -Function Str2Addr (S : String; Var Addr: RecEchoMailAddr) : Boolean; +Function Str2Addr (S: String; Var Addr: RecEchoMailAddr) : Boolean; Var A : Byte; B : Byte; C : Byte; + D : Byte; Point : Boolean; Begin Result := False; Point := True; + D := Pos('@', S); A := Pos(':', S); B := Pos('/', S); C := Pos('.', S); If (A = 0) or (B <= A) Then Exit; + If D > 0 Then + Delete (S, D, 255); + If C = 0 Then Begin Point := False; C := Length(S) + 1; diff --git a/mystic/bbs_msgbase.pas b/mystic/bbs_msgbase.pas index a135ce8..042cafa 100644 --- a/mystic/bbs_msgbase.pas +++ b/mystic/bbs_msgbase.pas @@ -83,11 +83,11 @@ Uses // BBS_Records, // BBS_Common, BBS_DataBase, - bbs_Core, - bbs_User, - bbs_NodeInfo, - bbs_NodeList, - bbs_cfg_UserEdit; + BBS_Core, + BBS_User, + BBS_NodeInfo, + BBS_NodeList, + BBS_cfg_UserEdit; Const QwkControlName = 'MYSTICQWK'; @@ -1351,7 +1351,9 @@ Begin Until False; If ReplyBase.NetType = 3 Then Begin - MsgBase^.GetOrig(Addr); +// If ReplyID <> '' Then + If Not Str2Addr(strWordGet(1, ReplyID, ' '), Addr) Then + MsgBase^.GetOrig(Addr); TempStr := NetmailLookup(False, ToWho, Addr2Str(Addr)); @@ -1781,6 +1783,7 @@ Var While Not MsgBase^.EOM Do Begin Temp := MsgBase^.GetString(79); + If Temp[1] <> #1 Then WriteLn (TF, Temp); End; @@ -2025,12 +2028,16 @@ Var CurMsg := MsgBase^.GetMsgNum; Lines := 0; PageStart := 1; + ReplyID := ''; If CurMsg > LastRead Then LastRead := CurMsg; Session.io.AllowArrow := True; - // create ReadMessageText function? + // create ReadMessageText function? This can also be used in the + // ASCII reader and in fact should be used, because if a more prompt + // is interrupted, its possible for a ReplyID to not be set. RepID + // is also not nulled prior to loading a new message. MsgBase^.MsgTxtStartUp; @@ -2272,6 +2279,7 @@ Var End; '?' : Begin Session.io.OutFile ('amsghlp2', True, 0); + Break; End; End; @@ -2665,6 +2673,10 @@ Var WereMsgs := True; Session.io.AllowPause := True; + // should be entirely read in and then filtered for kludge + // then displayed based on what was read in. replyID should + // be reset here + While Not MsgBase^.EOM Do Begin Str := MsgBase^.GetString(79); diff --git a/mystic/mis_common.pas b/mystic/mis_common.pas index f7d53b4..0085972 100644 --- a/mystic/mis_common.pas +++ b/mystic/mis_common.pas @@ -17,7 +17,6 @@ Var Function SearchForUser (UN: String; Var Rec: RecUser; Var RecPos: LongInt) : Boolean; Function CheckAccess (User: RecUser; IgnoreGroup: Boolean; Str: String) : Boolean; Function GetSecurityLevel (Level: Byte; SecLevel: RecSecurity) : Boolean; -//Function strAddr2Str (Addr : RecEchoMailAddr) : String; Implementation @@ -213,17 +212,4 @@ Begin Result := True; End; -(* -Function strAddr2Str (Addr : RecEchoMailAddr) : String; -Var - Temp : String[20]; -Begin - Temp := strI2S(Addr.Zone) + ':' + strI2S(Addr.Net) + '/' + - strI2S(Addr.Node); - - If Addr.Point <> 0 Then Temp := Temp + '.' + strI2S(Addr.Point); - - Result := Temp; -End; -*) End. diff --git a/mystic/mutil_common.pas b/mystic/mutil_common.pas index 21e678a..b56fd1c 100644 --- a/mystic/mutil_common.pas +++ b/mystic/mutil_common.pas @@ -42,7 +42,6 @@ Const Header_NODELIST = 'MergeNodeLists'; Procedure Log (Level: Byte; Code: Char; Str: String); -Function strAddr2Str (Addr : RecEchoMailAddr) : String; Function GetUserBaseSize : Cardinal; Function GenerateMBaseIndex : LongInt; Function GenerateFBaseIndex : LongInt; @@ -92,18 +91,6 @@ Begin Close (T); End; -Function strAddr2Str (Addr : RecEchoMailAddr) : String; -Var - Temp : String[20]; -Begin - Temp := strI2S(Addr.Zone) + ':' + strI2S(Addr.Net) + '/' + - strI2S(Addr.Node); - - If Addr.Point <> 0 Then Temp := Temp + '.' + strI2S(Addr.Point); - - Result := Temp; -End; - Function GetUserBaseSize : Cardinal; Begin Result := FileByteSize(bbsCfg.DataPath + 'users.dat'); @@ -377,14 +364,14 @@ Begin Msg^.SetSubj (mSubj); If (mArea.NetType > 0) and (mArea.QwkNetID = 0) Then - Msg^.DoStringLn (#1 + 'MSGID: ' + strAddr2Str(bbsCfg.NetAddress[mArea.NetAddr]) + ' ' + strI2H(CurDateDos, 8)); + Msg^.DoStringLn (#1 + 'MSGID: ' + Addr2Str(bbsCfg.NetAddress[mArea.NetAddr]) + ' ' + strI2H(CurDateDos, 8)); For Count := 1 to mLines Do Msg^.DoStringLn(mText[Count]); If mArea.NetType > 0 Then Begin - Msg^.DoStringLn (#13 + '--- ' + mysSoftwareID + ' BBS v' + mysVersion + ' (' + OSID + ')'); - Msg^.DoStringLn (' * Origin: ' + mArea.Origin + ' (' + strAddr2Str(bbsCfg.NetAddress[mArea.NetAddr]) + ')'); + Msg^.DoStringLn (#13 + '--- ' + mysSoftwareID + ' v' + mysVersion + ' (' + OSID + ')'); + Msg^.DoStringLn (' * Origin: ' + mArea.Origin + ' (' + Addr2Str(bbsCfg.NetAddress[mArea.NetAddr]) + ')'); End; Msg^.WriteMsg; diff --git a/mystic/mutil_echocore.pas b/mystic/mutil_echocore.pas index a461f81..632ad71 100644 --- a/mystic/mutil_echocore.pas +++ b/mystic/mutil_echocore.pas @@ -93,8 +93,10 @@ Type TPKTReader = Class PKTHeader : RecPKTHeader; - Orig : RecEchoMailAddr; - Dest : RecEchoMailAddr; + PKTOrig : RecEchoMailAddr; + PKTDest : RecEchoMailAddr; + MsgOrig : RecEchoMailAddr; + MsgDest : RecEchoMailAddr; MsgHdr : RecPKTMessageHdr; MsgFile : TFileBuffer; MsgTo : String[50]; @@ -105,9 +107,10 @@ Type MsgText : Array[1..mysMaxMsgLines] of ^RecMsgLine; MsgSize : LongInt; MsgLines : LongInt; - MsgArea : String; + MsgArea : String[60]; MsgCRC : RecMsgDupe; Opened : Boolean; + //IsNetMail : Boolean; Constructor Create; Destructor Destroy; Override; @@ -237,14 +240,14 @@ Begin Opened := False; End Else Begin - Orig.Zone := PKTHeader.OrigZone; - Orig.Net := PKTHeader.OrigNet; - Orig.Node := PKTHeader.OrigNode; - Dest.Zone := PKTHeader.DestZone; - Dest.Net := PKTHeader.DestNet; - Dest.Node := PKTHeader.DestNode; - Result := True; - Opened := True; + PKTOrig.Zone := PKTHeader.OrigZone; + PKTOrig.Net := PKTHeader.OrigNet; + PKTOrig.Node := PKTHeader.OrigNode; + PKTDest.Zone := PKTHeader.DestZone; + PKTDest.Net := PKTHeader.DestNet; + PKTDest.Node := PKTHeader.DestNode; + Result := True; + Opened := True; End; End; @@ -283,6 +286,8 @@ Begin MsgFrom := GetStr (#0); MsgSubj := GetStr (#0); MsgTime := Copy(MsgDate, 12, 5); + MsgOrig := PKTOrig; + MsgDest := PKTDest; Tmp := strUpper(Copy(MsgDate, 4, 3)); @@ -297,6 +302,7 @@ Begin DisposeText; First := True; +// IsNetmail := False; MsgSize := 0; Result := True; MsgLines := 1; @@ -331,10 +337,20 @@ Begin MsgText[MsgLines]^ := ''; Continue; - End Else - MsgArea := 'NETMAIL'; + End Else Begin + MsgArea := 'NETMAIL'; +// IsNetMail := True; + End; End; - +(* + If MsgText[MsgLines]^[1] = #1 Then Begin + If Copy(MsgText[MsgLines]^, 2, 4) = 'INTL' Then + Str2Addr(strWordGet(2, MsgText[MsgLines]^, ' '), MsgDest) + Else + If (Copy(MsgText[MsgLines]^, 2, 5) = 'MSGID') Then + Str2Addr(strWordGet(2, MsgText[MsgLines]^, ' '), MsgOrig); + End; +*) Inc (MsgSize, Length(MsgText[MsgLines]^)); Inc (MsgLines); diff --git a/mystic/mutil_echoexport.pas b/mystic/mutil_echoexport.pas index cee6964..ebbc001 100644 --- a/mystic/mutil_echoexport.pas +++ b/mystic/mutil_echoexport.pas @@ -95,7 +95,7 @@ Begin BundleName := BundlePath + GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + strLower(DayString[DayOfWeek(CurDateDos)]); BundleName[Length(BundleName)] := '0'; - + (* BundleName := BundlePath + GetFTNBundleExt(False, GetFTNArchiveName(OrigAddr, EchoNode.Address) + '.' + Copy(strLower(DayString[DayOfWeek(CurDateDos)]), 1, 2) + '0'); @@ -184,7 +184,7 @@ Var If IsValidAKA(MsgBase^.GetDestAddr.Zone, MsgBase^.GetDestAddr.Net, MsgBase^.GetDestAddr.Node) Then Exit; - Log (2, '+', ' Export #' + strI2S(MsgBase^.GetMsgNum) + ' to ' + strAddr2Str(EchoNode.Address)); + Log (2, '+', ' Export #' + strI2S(MsgBase^.GetMsgNum) + ' to ' + Addr2Str(EchoNode.Address)); GetDate (DT.Year, DT.Month, DT.Day, Temp); GetTime (DT.Hour, DT.Min, DT.Sec, Temp); @@ -287,8 +287,7 @@ Var WriteStr ('AREA:' + MBase.EchoTag, #13); If MBase.NetType = 3 Then Begin - WriteStr (#1 + 'INTL ' + strAddr2Str(MsgBase^.GetDestAddr) + ' ' + strAddr2Str(MsgBase^.GetOrigAddr), #13); - // Add Via here and do an ELSE TID for nettype <> 3? + WriteStr (#1 + 'INTL ' + Addr2Str(MsgBase^.GetDestAddr) + ' ' + Addr2Str(MsgBase^.GetOrigAddr), #13); End; WriteStr (#1 + 'TID: ' + mysSoftwareID + ' ' + mysVersion, #13); @@ -311,7 +310,8 @@ Var WriteStr (TempStr1, #13); WriteStr (#1 + 'PATH: ' + strI2S(MsgBase^.GetOrigAddr.Net) + '/' + strI2S(MsgBase^.GetOrigAddr.Node), #13); - End; + End;// Else +// WriteStr (#1 + 'Via ' + Addr2Str(MsgBase^.GetOrigAddr) + ' @' + FormatDate(CurDateDT, 'YYYYMMDD.HHIISS') + '.UTC ' + mysSoftwareID + ' ' + mysVersion, #13); WriteStr (#0#0, #0); Close (F); diff --git a/mystic/mutil_echoimport.pas b/mystic/mutil_echoimport.pas index 9cadf65..a297ce4 100644 --- a/mystic/mutil_echoimport.pas +++ b/mystic/mutil_echoimport.pas @@ -40,8 +40,8 @@ Begin MB^.SetMailType (mmtEchoMail); MB^.SetLocal (False); - MB^.SetOrig (PKT.Orig); - MB^.SetDest (PKT.Dest); + MB^.SetOrig (PKT.PKTOrig); + MB^.SetDest (PKT.PKTDest); MB^.SetPriv ((PKT.MsgHDR.Attribute AND pktPrivate <> 0) OR NetMail); MB^.SetCrash (PKT.MsgHDR.Attribute AND pktCrash <> 0); @@ -93,7 +93,7 @@ Var Exit; End; - If Not IsValidAKA(PKT.Dest.Zone, PKT.Dest.Net, PKT.Dest.Node) Then Begin + If Not IsValidAKA(PKT.PKTDest.Zone, PKT.PKTDest.Net, PKT.PKTDest.Node) Then Begin Log (3, '!', ' ' + JustFile(PktFN) + ' does not match an AKA'); PKT.Close; diff --git a/mystic/mutil_importmsgbase.pas b/mystic/mutil_importmsgbase.pas index dd9279a..fad3014 100644 --- a/mystic/mutil_importmsgbase.pas +++ b/mystic/mutil_importmsgbase.pas @@ -74,7 +74,7 @@ Begin MBase.FileName := strReplace(MBase.FileName, '\', '_'); For Count := 1 to 30 Do - If strAddr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin + If Addr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin MBase.NetAddr := Count; Break; diff --git a/mystic/mutil_importna.pas b/mystic/mutil_importna.pas index 3ddc292..94007d5 100644 --- a/mystic/mutil_importna.pas +++ b/mystic/mutil_importna.pas @@ -96,7 +96,7 @@ Begin MBase.FileName := strReplace(MBase.FileName, '\', '_'); For Count := 1 to 30 Do - If strAddr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin + If Addr2Str(bbsCfg.NetAddress[Count]) = INI.ReadString(Header_IMPORTNA, 'netaddress', '') Then Begin MBase.NetAddr := Count; Break; End;