X-Git-Url: http://git.osdn.net/view?p=gikonavigoeson%2Fgikonavi.git;a=blobdiff_plain;f=res%2FExternalBoardPlugIn%2FMachiBBSPlugIn.dpr;h=f3b1a7ea5481f2edc572ae919b457abeade3edca;hp=807ffdac6708623e21e7e4fced33e1464121b6c5;hb=becd331663d47edd844cba6862d933aef587bb62;hpb=99f2be3a17dfec20c0edcaaa09e20c39a74d3af9 diff --git a/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr b/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr index 807ffda..f3b1a7e 100644 --- a/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr +++ b/res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr @@ -86,7 +86,7 @@ const MAJOR_VERSION = 1; MINOR_VERSION = 0; RELEASE_VERSION = 'beta'; - REVISION_VERSION = 24; + REVISION_VERSION = 25; // ========================================================================= // ŽG—pŠÖ” @@ -454,6 +454,8 @@ end; // Žw’肵‚½ URL ‚̃XƒŒƒbƒh‚̃_ƒEƒ“ƒ[ƒh‚ðŽwŽ¦‚³‚ꂽ // ************************************************************************* function TMachiBBSThreadItem.Download : TDownloadState; +const + RES_ERROR: String = ''; var modified : Double; tmp : PChar; @@ -474,7 +476,8 @@ var if responseCode = 200 then begin // API‚Å‚ÍdatŒ`Ž®‚Å•Ô‚Á‚Ä‚­‚é content.Text := string( tmp ); - To2chDat2( content ); // Œ`Ž®•ÏŠ· + if (content.Count > 0) and (Pos(RES_ERROR, content.Strings[0]) <> 1) then + To2chDat2( content ); // Œ`Ž®•ÏŠ· (* ‹ŒŽd—liHTML‚ÅŽóM‚µdat‚É•ÏŠ·‚·‚éj downResult := TStringList.Create; try @@ -562,40 +565,42 @@ begin downAndParse; if content.Count > 0 then begin - if Count <= 0 then begin - Result := dsComplete; - // V‹K‘‚«ž‚Ý - content[ 0 ] := content[ 0 ] + Title; - logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); - try - logStream.Position := logStream.Size; - logStream.Write( PChar( content.Text )^, Length( content.Text ) ); - finally - logStream.Free; - end; - NewReceive := 1; - Count := content.Count; - end else begin - if (content.Count > 1) or (Trim(content.Text) <> '') then begin - Result := dsDiffComplete; - // ’Ç‹L - logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ); + if (Pos(RES_ERROR, content.Strings[0]) <> 1) then begin + if Count <= 0 then begin + Result := dsComplete; + // V‹K‘‚«ž‚Ý + content[ 0 ] := content[ 0 ] + Title; + logStream := TFileStream.Create( FilePath, fmCreate or fmShareDenyWrite ); try logStream.Position := logStream.Size; logStream.Write( PChar( content.Text )^, Length( content.Text ) ); finally logStream.Free; end; - NewReceive := Count + 1; - Count := Count + content.Count; + NewReceive := 1; + Count := content.Count; end else begin - Result := dsNotModify; + if (content.Count > 1) or (Trim(content.Text) <> '') then begin + Result := dsDiffComplete; + // ’Ç‹L + logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite ); + try + logStream.Position := logStream.Size; + logStream.Write( PChar( content.Text )^, Length( content.Text ) ); + finally + logStream.Free; + end; + NewReceive := Count + 1; + Count := Count + content.Count; + end else begin + Result := dsNotModify; + end; + end; + if (Result <> dsNotModify) then begin + // CGI ‚©‚ç‚͐³‚µ‚¢“ú•t‚ª“¾‚ç‚ê‚È‚¢‚Ì‚ÅŒ»Ý‚ɐݒè + LastModified := Now; + NewResCount := content.Count; end; - end; - if (Result <> dsNotModify) then begin - // CGI ‚©‚ç‚͐³‚µ‚¢“ú•t‚ª“¾‚ç‚ê‚È‚¢‚Ì‚ÅŒ»Ý‚ɐݒè - LastModified := Now; - NewResCount := content.Count; end; end else begin Result := dsNotModify;