From 89cc968daf8e3b6b16901943d50abfe4c868d7b1 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Thu, 24 Jan 2013 10:25:51 -0500 Subject: [PATCH] Fix copy/paste not generating unique ID --- mystic/bbs_cfg_msgbase.pas | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mystic/bbs_cfg_msgbase.pas b/mystic/bbs_cfg_msgbase.pas index 62a9106..d4601af 100644 --- a/mystic/bbs_cfg_msgbase.pas +++ b/mystic/bbs_cfg_msgbase.pas @@ -302,27 +302,32 @@ Var List.Add('', 2); End; - Procedure AssignRecord (Email: Boolean); + Function GetPermanentIndex (Start: LongInt) : LongInt; + Var + TempBase : RecMessageBase; Begin - MIndex := List.Picked; + Result := Start; Reset (MBaseFile); While Not EOF(MBaseFile) Do Begin - Read (MBaseFile, MBase); + Read (MBaseFile, TempBase); - If MIndex = MBase.Index Then Begin - Inc (MIndex); + If Result = TempBase.Index Then Begin + Inc (Result); Reset (MBaseFile); End; End; + End; + Procedure AssignRecord (Email: Boolean); + Begin AddRecord (MBaseFile, List.Picked, SizeOf(RecMessageBase)); FillChar (MBase, SizeOf(RecMessageBase), 0); With MBase Do Begin - Index := MIndex; + Index := GetPermanentIndex(List.Picked); FileName := 'new'; Path := Config.MsgsPath; Name := 'New Base'; @@ -418,6 +423,9 @@ Begin End; 'P' : If HasCopy And (List.Picked > 1) Then Begin AddRecord (MBaseFile, List.Picked, SizeOf(MBase)); + + Copied.Index := GetPermanentIndex(1); + Write (MBaseFile, Copied); MakeList;