OSDN Git Service

fusianasanのチェックの順番がおかしい問題の修正
authorh677 <h677>
Sun, 25 Jun 2006 15:57:58 +0000 (15:57 +0000)
committerh677 <h677>
Sun, 25 Jun 2006 15:57:58 +0000 (15:57 +0000)
Editor.pas

index c8329d0..0a0c78a 100644 (file)
@@ -118,7 +118,7 @@ type
     LocalEdit: TMemo;
     N6: TMenuItem;
     LocalRuleBrowse: TMenuItem;
-    ToolButton4: TToolButton;
+       ToolButton4: TToolButton;
     ToolButton6: TToolButton;
     SaveNameMailAction: TAction;
     ToolButton7: TToolButton;
@@ -840,7 +840,6 @@ var
        body : TStringList;
        Remote : String;
        ABoard : TBoard;
-       tmpRawheader: string;
     {Protocol,Host, Path, Document, Port, Bookmark : String;}
 begin
        FAbort := False;
@@ -852,7 +851,7 @@ begin
                Board := FThreadItem.ParentBoard;
 
 
-    tmpRawheader := '';
+//    tmpRawheader := '';
        InitIdHTTP(Indy);
        if FThreadItem = nil then begin
                URL := FBoard.GetSendURL;
@@ -910,35 +909,24 @@ begin
                try
                        FDebugStrReceive := '';
                        FDebugStrSend := '';
-                       GetSendData(Source);
-                       IdAntiFreeze.Active := True;
-                       try
-                               Indy.Post(URL, Source, TextStream);
-                       finally
-                               IdAntiFreeze.Active := False;
-                       end;
-                       ResponseText := TextStream.DataString;
 
-                       ResultType := GetResultType(ResponseText);
-
-                       //MsgResult\8f\89\8aú\89»
-                       MsgResult := IDNO;
-                       //\83t\83V\83A\83i\83g\83\89\83b\83v\8cx\8d\90(LocalMode) by \92è\8aú\95Ö
-                       if GikoSys.Setting.LocalTrapAtt then begin
-                               if LFusianaGet(Namae) then begin
-                                       MsgResult := MsgBox( Handle, MSG_FUSIANA, '\8fî\95ñ',
-                                               MB_YESNO or MB_ICONQUESTION);
-                                       if MsgResult = IDNO  then begin
-                                               CancelSend( Board, SysMenu );
-                                               Exit;
+                       if (FirstWriting) then begin
+                               //\83t\83V\83A\83i\83g\83\89\83b\83v\8cx\8d\90(LocalMode) by \92è\8aú\95Ö
+                               if GikoSys.Setting.LocalTrapAtt then begin
+                                       if LFusianaGet(Namae) then begin
+                                               MsgResult := MsgBox( Handle, MSG_FUSIANA, '\8fî\95ñ',
+                                                       MB_YESNO or MB_ICONQUESTION);
+                                               if MsgResult = IDNO  then begin
+                                                       CancelSend( Board, SysMenu );
+                                                       Exit;
+                                               end;
                                        end;
-                               end;
-                               if ((Namae = '\8eR\8dè\8fÂ') or (Namae = 'fusianasan')) then begin
-                                       MsgResult := MsgBox(Handle, MSG_FUSIANA, '\8fî\95ñ',
-                                       MB_YESNO or MB_ICONQUESTION);
-                                       if MsgResult = IDNO  then begin
-                                               CancelSend( Board, SysMenu );
-                                               Exit;
+                                       if ((Namae = '\8eR\8dè\8fÂ') or (Namae = 'fusianasan')) then begin
+                                               MsgResult := MsgBox(Handle, MSG_FUSIANA, '\8fî\95ñ',
+                                               MB_YESNO or MB_ICONQUESTION);
+                                               if MsgResult = IDNO  then begin
+                                                       CancelSend( Board, SysMenu );
+                                                       Exit;
                                                end;
                                        end;
                                end;
@@ -959,14 +947,10 @@ begin
                                                finally
                                                        body.Free;
                                                end;
-                                       end;
-
+                                       end else begin
                                        //Setting.txt\82ª\82È\82©\82Á\82½\82ç\8eæ\93¾
                                        //\8eI\82É\95\89\89×\82ª\82©\82©\82è\82»\82¤...
-                                       if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
-                                               //GetSETTINGTXTAction\82ð\8cÄ\82Ñ\8fo\82·\82ÆIndy\82ª\8f\89\8aú\89»\82³\82ê\82é\82Ì\82Å\81A
-                                               //\82±\82±\82ÅCookie\82ð\95Û\91\82µ\82È\82­\82Ä\82Í\82¢\82¯\82È\82¢
-                                               tmpRawheader := Indy.Response.RawHeaders.Text;
+                                       //if not FileExists(ABoard.GetSETTINGTXTFileName) then begin
                                                GetSETTINGTXTAction.Execute;
                                                body := TStringList.Create;
                                                try
@@ -976,88 +960,97 @@ begin
                                                        end;
                                                finally
                                                        body.Free;
-                                                       end;
-                                               end;
-
-                                               if Remote = 'fusianasan' then begin
-                                                       MsgResult := MsgBox(
-                                                               Handle, MSG_FUSIANA, '\8fî\95ñ',
-                                                               MB_YESNO or MB_ICONQUESTION);
-                                                       if MsgResult = IDNO  then begin
-                                                               CancelSend( Board, SysMenu );
-                                                               Exit;
-                                                       end;
                                                end;
                                        end;
 
-                                       if ResultType = grtOK then begin
-                                               if (GikoSys.Setting.UseSamba) and  (Timer1.Enabled) then
-                                                       WriteSambaTime(FHost, Now());
-                                                                               State := gdsComplete;
-                                                               end else if ResultType = grtCookie then begin
-                                               //\83\8b\81[\83v\96h\8e~
-                                               if not FirstWriting then
-                                                       raise Exception.Create('');
-                                                                               MsgResult := MsgBox(
-                                                                                               Handle,
-                                                '\81E\93\8a\8de\82³\82ê\82½\93à\97e\82Í\83R\83s\81[\81A\95Û\91\81A\88ø\97p\81A\93]\8dÚ\93\99\82³\82ê\82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B' + #13#10 +
-                                                '\81E\93\8a\8de\82É\8aÖ\82µ\82Ä\94­\90\82·\82é\90Ó\94C\82Í\91S\82Ä\93\8a\8de\8eÒ\82É\8bA\82µ\82Ü\82·\81B' + #13#10#13#10 +
-                                                '\91S\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H',
-                                                '\8fî\95ñ',
-                                                MB_YESNO or MB_ICONQUESTION);
-                                       if MsgResult = IDYES then begin
-                                               if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
-                                                       GetCookie(tmpRawheader, Board);
-                                                       end else begin
-                                                               GetCookie(Indy.Response.RawHeaders.Text, Board);
-                                               end;
-                                               if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
-                                                       raise Exception.Create('');
-                                               //\82à\82¤\88ê\89ñ\82±\82Ì\83\81\83\\83b\83h
-                                                       Send(Board.Cookie, Board.SPID, Board.PON, False);
-                                               Exit;
-                                               end else begin
+                                       if Remote = 'fusianasan' then begin
+                                               MsgResult := MsgBox(
+                                                       Handle, MSG_FUSIANA, '\8fî\95ñ',
+                                                       MB_YESNO or MB_ICONQUESTION);
+                                               if MsgResult = IDNO  then begin
                                                        CancelSend( Board, SysMenu );
                                                        Exit;
-                                       end;
-                               end else if ResultType = grtCheck then begin
-                                       //\83\8b\81[\83v\96h\8e~
-                                       if not FirstWriting then
-                                               raise Exception.Create('');
-
-                                       MsgResult := MsgBox(
-                                               Handle,
-                                               '\8f\91\82«\8d\9e\82Ý\82É\8aÖ\82µ\82Ä\82Í\97l\81X\82È\83\8d\83O\8fî\95ñ\82ª\8bL\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B' + #13#10 +
-                                               '\93\8a\8de\82É\8aÖ\82µ\82Ä\94­\90\82·\82é\90Ó\94C\82Í\91S\82Ä\93\8a\8de\8eÒ\82É\8bA\82µ\82Ü\82·\81B' + #13#10 +
-                                               '\8cö\8f\98\97Ç\91­\82É\94½\82µ\82½\82è\81A\91¼\90l\82É\96À\98f\82ð\82©\82¯\82é\8f\91\82«\8d\9e\82Ý\82Í\8dT\82¦\82Ä\89º\82³\82¢\81B' + #13#10 +
-                                               '\93\8a\8de\82³\82ê\82½\93à\97e\82Í\83R\83s\81[\81E\95Û\91\81E\88ø\97p\81E\93]\8dÚ\93\99\82³\82ê\82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B' + #13#10 +
-                                               #13#10 +
-                                               '\91S\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H',
-                                               '\8am\94F',
-                                               MB_YESNO or MB_ICONQUESTION);
-
-                                       if MsgResult = IDYES then begin
-                                                if (GikoSys.Setting.RemoteTrapAtt) and (tmpRawheader <> '') then begin
-                                                       GetCookie(tmpRawheader, Board);
-                                       end else begin
-                                               GetCookie(Indy.Response.RawHeaders.Text, Board);
-                                        end;
+                                               end;
+                                       end;
+                               end;
+                       end;
 
-                                        if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
-                                                raise Exception.Create('');
-                                               Send(Board.Cookie, Board.SPID, Board.PON, False);
-                                               Exit;
-                                       end else begin
-                                                       CancelSend( Board, SysMenu );
-                                               Exit;
-                                       end;
-                               end else begin
-                                               if (GikoSys.Setting.UseSamba)  and  (Timer1.Enabled) then
-                                                       WriteSambaTime(FHost, Now());
-                                                       State := gdsError;
-                                                       raise Exception.Create('');
-                               end;
+                       GetSendData(Source);
+                       IdAntiFreeze.Active := True;
+                       try
+                               Indy.Post(URL, Source, TextStream);
+                       finally
+                               IdAntiFreeze.Active := False;
+                       end;
+                       ResponseText := TextStream.DataString;
+
+                       ResultType := GetResultType(ResponseText);
+
+
+                       if ResultType = grtOK then begin
+                               if (GikoSys.Setting.UseSamba) and  (Timer1.Enabled) then
+                                       WriteSambaTime(FHost, Now());
+
+                               State := gdsComplete;
+                       end else if ResultType = grtCookie then begin
+                               //\83\8b\81[\83v\96h\8e~
+                               if not FirstWriting then
+                                       raise Exception.Create('');
 
+                               MsgResult := MsgBox( Handle,
+                                                               '\81E\93\8a\8de\82³\82ê\82½\93à\97e\82Í\83R\83s\81[\81A\95Û\91\81A\88ø\97p\81A\93]\8dÚ\93\99\82³\82ê\82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B' + #13#10 +
+                                                               '\81E\93\8a\8de\82É\8aÖ\82µ\82Ä\94­\90\82·\82é\90Ó\94C\82Í\91S\82Ä\93\8a\8de\8eÒ\82É\8bA\82µ\82Ü\82·\81B' + #13#10#13#10 +
+                                                               '\91S\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H',
+                                                               '\8fî\95ñ',
+                                                               MB_YESNO or MB_ICONQUESTION);
+
+                               if MsgResult = IDYES then begin
+                                       GetCookie(Indy.Response.RawHeaders.Text, Board);
+
+                                       if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
+                                               raise Exception.Create('');
+
+                                       //\82à\82¤\88ê\89ñ\82±\82Ì\83\81\83\\83b\83h
+                                       Send(Board.Cookie, Board.SPID, Board.PON, False);
+                                       Exit;
+                               end else begin
+                                       CancelSend( Board, SysMenu );
+                                       Exit;
+                               end;
+                       end else if ResultType = grtCheck then begin
+                               //\83\8b\81[\83v\96h\8e~
+                               if not FirstWriting then
+                                       raise Exception.Create('');
+
+                               MsgResult := MsgBox( Handle,
+                                               '\8f\91\82«\8d\9e\82Ý\82É\8aÖ\82µ\82Ä\82Í\97l\81X\82È\83\8d\83O\8fî\95ñ\82ª\8bL\98^\82³\82ê\82Ä\82¢\82Ü\82·\81B' + #13#10 +
+                                               '\93\8a\8de\82É\8aÖ\82µ\82Ä\94­\90\82·\82é\90Ó\94C\82Í\91S\82Ä\93\8a\8de\8eÒ\82É\8bA\82µ\82Ü\82·\81B' + #13#10 +
+                                               '\8cö\8f\98\97Ç\91­\82É\94½\82µ\82½\82è\81A\91¼\90l\82É\96À\98f\82ð\82©\82¯\82é\8f\91\82«\8d\9e\82Ý\82Í\8dT\82¦\82Ä\89º\82³\82¢\81B' + #13#10 +
+                                               '\93\8a\8de\82³\82ê\82½\93à\97e\82Í\83R\83s\81[\81E\95Û\91\81E\88ø\97p\81E\93]\8dÚ\93\99\82³\82ê\82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B' + #13#10 +
+                                               #13#10 +
+                                               '\91S\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H',
+                                               '\8am\94F',
+                                               MB_YESNO or MB_ICONQUESTION);
+
+                               if MsgResult = IDYES then begin
+                                       GetCookie(Indy.Response.RawHeaders.Text, Board);
+
+                                       if (Board.SPID = '') and (Board.PON = '') and (Board.Cookie = '') then
+                                               raise Exception.Create('');
+
+                                       Send(Board.Cookie, Board.SPID, Board.PON, False);
+                                       Exit;
+                               end else begin
+                                       CancelSend( Board, SysMenu );
+                                       Exit;
+                               end;
+                       end else begin
+                               if (GikoSys.Setting.UseSamba)  and  (Timer1.Enabled) then
+                                       WriteSambaTime(FHost, Now());
+
+                               State := gdsError;
+                               raise Exception.Create('');
+                       end;
                except
                        on E: EIdConnectException do begin
                                State := gdsError;