OSDN Git Service

したらばJBBSの同IDレスポップアップに対応
authorh677 <h677>
Mon, 8 Nov 2004 14:38:54 +0000 (14:38 +0000)
committerh677 <h677>
Mon, 8 Nov 2004 14:38:54 +0000 (14:38 +0000)
GikoSystem.pas

index cafcd97..9a11e13 100644 (file)
@@ -96,6 +96,7 @@ type
 
 //             FExitWrite: TStringList;
 //             function StrToFloatDef(s: string; Default: Double): Double;
+               function NotDateorTimeString(const AStr : string): boolean;
        public
                { Public \90é\8c¾ }
                FAbon : TAbon;
@@ -3933,6 +3934,8 @@ var
        Res: TResRec;
        boardPlugIn : TBoardPlugIn;
        AID : String;
+       stList: TStringList;
+       i : Integer;
 begin
        if (ThreadItem <> nil) and (ThreadItem.IsLogFile)
                and (AIDNum > 0) and (AIDNum <= ThreadItem.Count) then begin
@@ -3944,11 +3947,42 @@ begin
                        Res := DivideStrLine( ReadThreadFile(ThreadItem.GetThreadFileName, AIDNum));
                end;
                AID := Res.FDateTime;
-               AID := Copy(AID, AnsiPos('id', AnsiLowerCase(AID)) - 1, 11);
-        GetSameIDRes(AID, ThreadItem, body);
+               if AnsiPos('id', AnsiLowerCase(AID)) > 0 then
+                       AID := Copy(AID, AnsiPos('id', AnsiLowerCase(AID)) - 1, 11)
+               else begin
+                       stlist := TStringList.Create;
+                       try
+                               stList.DelimitedText := AID;
+                               for i := 0 to stList.Count - 1 do
+                                       if Length(stList[i]) = 8 then begin
+                                               if NotDateorTimeString(stList[i]) then begin
+                                                       AID := stList[i];
+                                                       break;
+                                               end;
+                                       end;
+                       finally
+                               stList.Free;
+                       end;
+               end;
+
+               GetSameIDRes(AID, ThreadItem, body);
        end;
 end;
+function TGikoSys.NotDateorTimeString(const AStr : string): boolean;
+begin
+       Result := false;
+       try
+               StrToDate(AStr);
+       except
+               try
+                       StrToTime(AStr);
+                       Result := false;
+               except
+                       Result := true;
+               end;
+       end;
 
+end;
 
 procedure TGikoSys.SpamCountWord( const text : string; wordCount : TWordCount );
 begin