OSDN Git Service

まちBBSでエラー文字列を受信した場合に削除レスと同じ扱いにしてしまう不具合を修正
authorzako <zako@users.sourceforge.jp>
Thu, 18 Dec 2014 11:36:16 +0000 (20:36 +0900)
committerzako <zako@users.sourceforge.jp>
Thu, 18 Dec 2014 11:36:16 +0000 (20:36 +0900)
gikoNavi.res
res/ExternalBoardPlugIn/MachiBBSPlugIn.dpr
res/ExternalBoardPlugIn/MachiBBSPlugIn.res

index d9e594a..d9a7c1f 100644 (file)
Binary files a/gikoNavi.res and b/gikoNavi.res differ
index 807ffda..f3b1a7e 100644 (file)
@@ -86,7 +86,7 @@ const
        MAJOR_VERSION                   = 1;
        MINOR_VERSION                   = 0;
        RELEASE_VERSION         = 'beta';
-       REVISION_VERSION        = 24;
+       REVISION_VERSION        = 25;
 
 // =========================================================================
 // \8eG\97p\8aÖ\90\94
@@ -454,6 +454,8 @@ end;
 // \8ew\92è\82µ\82½ URL \82Ì\83X\83\8c\83b\83h\82Ì\83_\83E\83\93\83\8d\81[\83h\82ð\8ew\8e¦\82³\82ê\82½
 // *************************************************************************
 function TMachiBBSThreadItem.Download : TDownloadState;
+const
+    RES_ERROR: String = '<ERROR>';
 var
        modified                        : Double;
        tmp                                             : PChar;
@@ -474,7 +476,8 @@ var
                        if responseCode = 200 then begin
                 // API\82Å\82Ídat\8c`\8e®\82Å\95Ô\82Á\82Ä\82­\82é
                 content.Text := string( tmp );
-                To2chDat2( content );   // \8c`\8e®\95Ï\8a·
+                if (content.Count > 0) and (Pos(RES_ERROR, content.Strings[0]) <> 1) then
+                    To2chDat2( content );   // \8c`\8e®\95Ï\8a·
 (* \8b\8c\8ed\97l\81iHTML\82Å\8eó\90M\82µdat\82É\95Ï\8a·\82·\82é\81j
                                downResult      := TStringList.Create;
                                try
@@ -562,40 +565,42 @@ begin
                downAndParse;
 
                if content.Count > 0 then begin
-                       if Count <= 0 then begin
-                               Result := dsComplete;
-                               // \90V\8bK\8f\91\82«\8d\9e\82Ý
-                               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;
-                    // \92Ç\8bL
-                    logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite );
+            if (Pos(RES_ERROR, content.Strings[0]) <> 1) then begin
+                if Count <= 0 then begin
+                    Result := dsComplete;
+                    // \90V\8bK\8f\91\82«\8d\9e\82Ý
+                    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;
+                        // \92Ç\8bL
+                        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 \82©\82ç\82Í\90³\82µ\82¢\93ú\95t\82ª\93¾\82ç\82ê\82È\82¢\82Ì\82Å\8c»\8dÝ\82É\90Ý\92è
+                    LastModified       := Now;
+                    NewResCount                := content.Count;
                 end;
-                       end;
-            if (Result <> dsNotModify) then begin
-                       // CGI \82©\82ç\82Í\90³\82µ\82¢\93ú\95t\82ª\93¾\82ç\82ê\82È\82¢\82Ì\82Å\8c»\8dÝ\82É\90Ý\92è
-                       LastModified    := Now;
-                       NewResCount             := content.Count;
             end;
                end else begin
                        Result := dsNotModify;
index ba1e1da..f771f2d 100644 (file)
Binary files a/res/ExternalBoardPlugIn/MachiBBSPlugIn.res and b/res/ExternalBoardPlugIn/MachiBBSPlugIn.res differ