OSDN Git Service

タスクトレイへの格納で、レスエディタのタスクバーが消えない不具合の修正
[gikonavigoeson/gikonavi.git] / Editor.pas
index 38d8356..0a0c78a 100644 (file)
@@ -118,7 +118,7 @@ type
     LocalEdit: TMemo;
     N6: TMenuItem;
     LocalRuleBrowse: TMenuItem;
-    ToolButton4: TToolButton;
+       ToolButton4: TToolButton;
     ToolButton6: TToolButton;
     SaveNameMailAction: TAction;
     ToolButton7: TToolButton;
@@ -133,6 +133,8 @@ type
     ToolButton8: TToolButton;
     ToolButton9: TToolButton;
     ShowInputAssistForm: TAction;
+    ReleaseCookieAction: TAction;
+    Cookie1: TMenuItem;
 
                procedure EditorPageChange(Sender: TObject);
                procedure FormCreate(Sender: TObject);
@@ -191,6 +193,9 @@ type
     procedure ApplicationEvents1Message(var Msg: tagMSG;
       var Handled: Boolean);
     procedure ShowInputAssistFormExecute(Sender: TObject);
+    procedure ReleaseCookieActionExecute(Sender: TObject);
+    procedure GetSETTINGTXTActionUpdate(Sender: TObject);
+    procedure GetHeadTXTActionUpdate(Sender: TObject);
        private
                FThreadItem: TThreadItem;
                FBoard: TBoard;
@@ -260,6 +265,8 @@ type
                procedure InputAssistMenuClick(Sender: TObject);
                //! TMemo\82Ì\83J\81[\83\\83\8b\88Ê\92u\82É\95\8e\9a\97ñ\91}\93ü
                procedure InsertText(Memo: TMemo; Text: String);
+               //! \91\97\90M\92\86\8e~
+               procedure CancelSend(ABoard: TBoard; ASysMenu: HMENU);
        protected
                procedure CreateParams(var Params: TCreateParams); override;
        public
@@ -300,17 +307,6 @@ const
        RES2CH_CHECK                    = '<!-- 2ch_X:check -->';
        RES2CH_COOKIE                   = '<!-- 2ch_X:cookie -->';
 
-
-        BBS2CH_NAME:                                    string = '\82Q\82¿\82á\82ñ\82Ë\82é';
-       BBS2CH_LOG_FOLDER:               string = '2ch';
-       EXTERNAL_LOG_FOLDER:            string  = 'exboard';
-
-       FOLDER_INI_FILENAME:     string = 'Folder.ini';
-       FOLDER_INDEX_FILENAME: string   = 'Folder.idx';
-       SUBJECT_FILENAME:                       string  = 'subject.txt';
-       PATH_DELIM:                                             string  = '\';
-
-
 type
        TSelection = record
                StartPos, EndPos: Integer;
@@ -674,6 +670,9 @@ begin
 end;
 
 function TEditorForm.Check: Boolean;
+const
+       REQUIRED: string = '\82ª\93ü\97Í\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B';
+       ERROR: string = '\83G\83\89\81[';
 var
        Msg: string;
        rc: Integer;
@@ -690,15 +689,15 @@ begin
                        (Board.LastGetTime = ZERO_DATE)) then begin
                Msg := '\83T\81[\83o\82Ì\8e\9e\8d\8f\82ª\95ª\82©\82ç\82È\82¢\82½\82ß\81A\91\97\90M\8fo\97\88\82Ü\82¹\82ñ'#13#10
                                 + '\83X\83\8c\83b\83h\82ð\8dX\90V\81i\8eæ\93¾\81j\8cã\81A15\95b\91Ò\82Á\82Ä\82©\82ç\91\97\90M\82µ\82Ä\82­\82¾\82³\82¢';
-               MsgBox(Handle, Msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+               MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
                Result := False;
        end else if BodyEdit.Text = '' then begin
-               Msg := '\96{\95\82ª\93ü\97Í\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B';
-               MsgBox(Handle, Msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+               Msg := '\96{\95' + REQUIRED;
+               MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
                Result := False;
        end else if (FBoard <> nil) and (Trim(TitleEdit.Text) = '') then begin
-               Msg := '\83^\83C\83g\83\8b\82ª\93ü\97Í\82³\82ê\82Ä\82¢\82Ü\82¹\82ñ\81B';
-               MsgBox(Handle, Msg, '\83G\83\89\81[', MB_OK or MB_ICONSTOP);
+               Msg := '\83^\83C\83g\83\8b' + REQUIRED;
+               MsgBox(Handle, Msg, ERROR, MB_OK or MB_ICONSTOP);
                Result := False;
        end else begin
                if (not GikoSys.Dolib.Connected) and (AnsiPos('\81\9c', NameComboBox.Text) <> 0) then begin
@@ -809,8 +808,21 @@ begin
        Indy.Request.UserAgent := GikoSys.GetUserAgent;
        Indy.Request.AcceptEncoding := '';
 end;
+//! \91\97\90M\92\86\8e~\82Ì\82½\82ß\82Ì\83\81\83j\83\85\81[\82Ì\8dÄ\90
+procedure TEditorForm.CancelSend(ABoard: TBoard; ASysMenu: HMENU);
+begin
+       ABoard.SPID := '';
+       ABoard.PON := '';
+       FWork := false;
+       EnableMenuItem(ASysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
+       DrawMenuBar(Handle);
+end;
 
 procedure TEditorForm.Send(ACOOKIE: string; SPID: string; PON: string; FirstWriting: Boolean);
+const
+       MSG_FUSIANA : string =  '\83\8a\83\82\81[\83g\83z\83X\83g\82ð\95\\8e¦\82·\82é\8b@\94\\82ª\8eg\82í\82ê\82Ä\82¢\82Ü\82·'#13#10 +
+               '\82à\82µ\82à\8aÔ\88á\82Á\82Ä\82±\82Ì\95û\96@\82Å\83z\83X\83g\82ª\95\\8e¦\82³\82ê\82½\82Æ\82µ\82Ä\82à\81A\8e©\8cÈ\90Ó\94C\82È\82Ì\82Å\8dí\8f\9c\88Ë\97\8a\82É\82Í\89\9e\82\82Ü\82¹\82ñ\81B' +
+               #13#10#13#10'\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Ý\82Ü\82·\82©\81H';
 var
        TextStream: TStringStream;
        Source: TStringStream;
@@ -828,7 +840,6 @@ var
        body : TStringList;
        Remote : String;
        ABoard : TBoard;
-       tmpRawheader: string;
     {Protocol,Host, Path, Document, Port, Bookmark : String;}
 begin
        FAbort := False;
@@ -840,7 +851,7 @@ begin
                Board := FThreadItem.ParentBoard;
 
 
-    tmpRawheader := '';
+//    tmpRawheader := '';
        InitIdHTTP(Indy);
        if FThreadItem = nil then begin
                URL := FBoard.GetSendURL;
@@ -855,7 +866,7 @@ begin
 
        Cookie := '';
        if ACOOKIE <> '' then
-       Cookie := ACOOKIE;
+          Cookie := ACOOKIE;
        if SPID <> '' then
                Cookie := Cookie + 'SPID=' + SPID + '; ';
        if PON <> '' then
@@ -864,9 +875,19 @@ begin
        //\83z\83X\83g\82ª2ch\82Å\81ABe\82ÉLogin\82µ\82Ä\82¢\82ê\82ÎBE\82Ì\83f\81[\83^\82ð\91\97\82é
        //GikoSys.ParseURI( URL, Protocol,Host, Path, Document, Port, Bookmark );
        //if GikoSys.Is2chHost(Host) and GikoSys.Setting.BeLogin then
-       if (Board.Is2ch) and (GikoSys.Setting.BeLogin) then
-           Cookie := Cookie + 'MDMD=' + GikoSys.Setting.BeCode + '; '
-                       + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
+       if (Board.Is2ch) then begin
+               // \8cÅ\92è\82Ì\83N\83b\83L\81[\82ª\82 \82ê\82Î\90H\82í\82¹\82é
+               if Length(GikoSys.Setting.FixedCookie) > 0 then begin
+                       // \83z\83X\83g\82ª2ch\82Ì\8fê\8d\87\81C\8cÅ\92è\82Ì\83N\83b\83L\81[\82ð\90H\82í\82¹\82é
+                       Cookie := Cookie + GikoSys.Setting.FixedCookie + '; ';
+               end;
+               if (GikoSys.Setting.BeLogin) then begin
+                       Cookie := Cookie + 'MDMD=' + GikoSys.Setting.BeCode + '; '
+                                       + 'DMDM=' + GikoSys.Setting.BeUserID + '; ';
+               end;
+
+       end;
+
        Cookie := 'Cookie: ' + Cookie + 'NAME=' + NameComboBox.Text + '; MAIL=' + MailComboBox.Text;
 
        sysMenu := GetSystemMenu( Handle, false );
@@ -888,6 +909,72 @@ begin
                try
                        FDebugStrReceive := '';
                        FDebugStrSend := '';
+
+                       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;
+                                       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;
+
+                               if GikoSys.Setting.RemoteTrapAtt then begin
+                                       if FThreadItem = nil then
+                                               ABoard := FBoard
+                                       else
+                                               ABoard := FThreadItem.ParentBoard;
+
+                                       if ABoard = nil then Exit;
+
+                                       if FileExists(ABoard.GetSETTINGTXTFileName)  then begin
+                                               body := TStringList.Create;
+                                               try
+                                                       body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
+                                                       Remote := GetFusianaName(body, ABoard);
+                                               finally
+                                                       body.Free;
+                                               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.Execute;
+                                               body := TStringList.Create;
+                                               try
+                                                       if FileExists(ABoard.GetSETTINGTXTFileName) then begin
+                                                               body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
+                                                               Remote := GetFusianaName(body, ABoard);
+                                                       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;
+                       end;
+
                        GetSendData(Source);
                        IdAntiFreeze.Active := True;
                        try
@@ -899,177 +986,71 @@ begin
 
                        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,
-                                               '\83\8a\83\82\81[\83g\83z\83X\83g\82ð\95\\8e¦\82·\82é\8b@\94\\82ª\8eg\82í\82ê\82Ä\82¢\82Ü\82·' + #13#10 +
-                                               '\82à\82µ\82à\8aÔ\88á\82Á\82Ä\82±\82Ì\95û\96@\82Å\83z\83X\83g\82ª\95\\8e¦\82³\82ê\82½\82Æ\82µ\82Ä\82à\81A\8e©\8cÈ\90Ó\94C\82È\82Ì\82Å\8dí\8f\9c\88Ë\97\8a\82É\82Í\89\9e\82\82Ü\82¹\82ñ\81B' + #13#10#13#10 +
-                                               '\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 = IDNO  then begin
-                                               Board.SPID := '';
-                                               Board.PON := '';
-                                               FWork := false;
-                                               EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-                                               DrawMenuBar(Handle);
-                                               Exit;
-                                        end;
-                                end;
-                               if ((Namae = '\8eR\8dè\8fÂ') or (Namae = 'fusianasan')) then begin
-                                       MsgResult := MsgBox(
-                                                       Handle,
-                                               '\83\8a\83\82\81[\83g\83z\83X\83g\82ð\95\\8e¦\82·\82é\8b@\94\\82ª\8eg\82í\82ê\82Ä\82¢\82Ü\82·' + #13#10 +
-                                               '\82à\82µ\82à\8aÔ\88á\82Á\82Ä\82±\82Ì\95û\96@\82Å\83z\83X\83g\82ª\95\\8e¦\82³\82ê\82½\82Æ\82µ\82Ä\82à\81A\8e©\8cÈ\90Ó\94C\82È\82Ì\82Å\8dí\8f\9c\88Ë\97\8a\82É\82Í\89\9e\82\82Ü\82¹\82ñ\81B' + #13#10#13#10 +
-                                               '\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 = IDNO  then begin
-                                               Board.SPID := '';
-                                               Board.PON := '';
-                                               FWork := false;
-                                               EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-                                               DrawMenuBar(Handle);
-                                               Exit;
-                                       end;
-                               end;
-                        end;
-
-                        if GikoSys.Setting.RemoteTrapAtt then begin
-                               if FThreadItem = nil then
-                                       ABoard := FBoard
-                               else
-                                       ABoard := FThreadItem.ParentBoard;
-
-                               if ABoard = nil then Exit;
-
-                                                               if FileExists(ABoard.GetSETTINGTXTFileName)  then begin
-                                                                               body := TStringList.Create;
-                                                                               try
-                                                                                               body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
-                                                                                               Remote := GetFusianaName(body, ABoard);
-                                                                               finally
-                                                                                               body.Free;
-                                                                               end;
-                                                               end;
-
-                                                               //Setting.txt\82ª\82È\82©\82Á\82½\82ç\8eæ\93¾
-                                                               //\8eI\82É\95\89\89×\82ª\82©\82©\82è\82»\82¤\82Å\95|\82¢\81E\81E\81E
-                                                               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;
-                                                                               GetSETTINGTXTAction.Execute;
-                                                                               body := TStringList.Create;
-                                                                               try
-                                                                                               if FileExists(ABoard.GetSETTINGTXTFileName) then begin
-                                                                                                       body.LoadFromFile(ABoard.GetSETTINGTXTFileName);
-                                                                                                       Remote := GetFusianaName(body, ABoard);
-                                                                                               end;
-                                                                               finally
-                                                                                               body.Free;
-                                                                               end;
-                                end;
-
-                                                               if Remote = 'fusianasan' then begin
-                                       MsgResult := MsgBox(
-                                                       Handle,
-                                               '\83\8a\83\82\81[\83g\83z\83X\83g\82ð\95\\8e¦\82·\82é\8b@\94\\82ª\8eg\82í\82ê\82Ä\82¢\82Ü\82·' + #13#10 +
-                                               '\82à\82µ\82à\8aÔ\88á\82Á\82Ä\82±\82Ì\95û\96@\82Å\83z\83X\83g\82ª\95\\8e¦\82³\82ê\82½\82Æ\82µ\82Ä\82à\81A\8e©\8cÈ\90Ó\94C\82È\82Ì\82Å\8dí\8f\9c\88Ë\97\8a\82É\82Í\89\9e\82\82Ü\82¹\82ñ\81B' + #13#10#13#10 +
-                                               '\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 = IDNO  then begin
-                                               Board.SPID := '';
-                                               Board.PON := '';
-                                                       FWork := false;
-                                               EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-                                               DrawMenuBar(Handle);
-                                               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);
+
+                               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;
+                                       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
-                                       Board.SPID := '';
-                                       Board.PON := '';
-                                       FWork := false;
-                                       EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-                                       DrawMenuBar(Handle);
+                                       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);
+                               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;
+                                       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
-                                       EnableMenuItem(SysMenu, SC_CLOSE, MF_BYCOMMAND or MF_ENABLED);
-                                       DrawMenuBar(Handle);
-                                       Board.SPID := '';
-                                       Board.PON := '';
-                                       FWork := false;
+                                       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;
+                               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;
@@ -1110,8 +1091,9 @@ begin
                DrawMenuBar(Handle);
        end;
        FWork := false;
-    //\94ñ\8cö\8e®\83M\83R\83i\83r\94Â\82È\82Ç\82Ì\83X\83N\83\8a\83v\83g\97p
-    //ResponceCode\82ª302Found\82Å\8f\91\82«\8d\9e\82Ý\8a®\97¹
+    //\94ñ\8cö\8e®\83M\83R\83i\83r\94Â\82È\82Ç\82Ì2ch\8cÝ\8a·\83X\83N\83\8a\83v\83g\97p
+    //2ch\88È\8aO\82Å\82©\82ÂResponceCode\82ª302Found\82Å\8f\91\82«\8d\9e\82Ý\8a®\97¹
+    //if (not Board.Is2ch) and (FStatusCode = 302) then begin
     if FStatusCode = 302 then begin
         GikoForm.PlaySound('ResEnd');
         SaveSendFile;
@@ -1202,12 +1184,13 @@ begin
                s := 'sid=' + HttpEncode(SessionID) + '&'
        else
                s := '';
-       s := s + 'subject=&'
-                                + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
-                                + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
-                                + 'MESSAGE=' + HttpEncode(body) + '&'
-                                + 'bbs=' + Board.BBSID + '&'
-                                + 'time=' + IntToStr(SendTime) + '&';
+        s := s + 'subject=&'
+               + 'FROM=' + HttpEncode(NameComboBox.Text) + '&'
+               + 'mail=' + HttpEncode(MailComboBox.Text) + '&'
+               + 'MESSAGE=' + HttpEncode(body) + '&'
+               + 'bbs=' + Board.BBSID + '&'
+                          + 'time=' + IntToStr(SendTime) + '&';
+                          
        if FThreadItem = nil then begin
                s := s + 'subject=' + HttpEncode(TitleEdit.Text) + '&';
                s := s + 'submit=' + HttpEncode('\91S\90Ó\94C\82ð\95\89\82¤\82±\82Æ\82ð\8f³\91ø\82µ\82Ä\8f\91\82«\8d\9e\82Þ') + #13#10;
@@ -1249,6 +1232,8 @@ begin
 end;
 
 procedure TEditorForm.SendActionExecute(Sender: TObject);
+const
+       TITLE_SAMBA : string = 'Samba24\8cx\8d\90';
 var
        Board: TBoard;
        rc: Integer;
@@ -1336,7 +1321,7 @@ begin
                                        rc := GikoUtil.MsgBox(Handle,
                                                                'Samba24\82Ì\8bK\92è\92l\96¢\96\9e\82Ì\95b\90\94\82µ\82©\8co\89ß\82µ\82Ä\82¢\82Ü\82¹\82ñ\81B'#13#10
                                                                + '\91\97\90M\82ð\92\86\8e~\82µ\82Ü\82·\82©\81H' + #13#10
-                                                               + '(\81u\82¢\82¢\82¦\81v\82¾\82Æ\91\97\90M\82µ\82Ü\82·)', 'Samba24\8cx\8d\90',
+                                                               + '(\81u\82¢\82¢\82¦\81v\82¾\82Æ\91\97\90M\82µ\82Ü\82·)', TITLE_SAMBA,
                                                                MB_YESNO or MB_ICONQUESTION);
                                        if rc = IDYES then begin
                                                FWork := false;
@@ -1345,7 +1330,7 @@ begin
                                         if rc = IDNO then begin
                                                 rc2 := GikoUtil.MsgBox(Handle,
                                                                        '\96{\93\96\82É\91\97\90M\82µ\82Ü\82·\82©\81H',
-                                                                       'Sumba24\8cx\8d\90',
+                                                                       TITLE_SAMBA,
                                                                        MB_YESNO or MB_ICONQUESTION);
                                                 if rc2 = IDNO then begin
                                                         FWork := False;
@@ -1751,6 +1736,12 @@ var
        tmpBoard: TBoard;
 begin
 
+       if FWork then begin
+               Exit;
+       end;
+
+       FWork := True;
+
        InitIdHTTP(Indy);
        if FThreadItem = nil then
                tmpBoard := FBoard
@@ -1797,9 +1788,11 @@ begin
        finally
                settingBody.Free;
                Screen.Cursor := crDefault;
+               FWork := False;
        end;
        ShowBoardInformation(tmpBoard, BoardInformationMemo);
 
+
 end;
 
 procedure TEditorForm.ShowBoardInformation(ABoard: TBoard; AMemo: TMemo);
@@ -1858,6 +1851,10 @@ begin
        else
                GetTitlePictureAction.Enabled :=  FThreadItem.ParentBoard.IsSETTINGTXT;
 
+       if GetTitlePictureAction.Enabled Then begin
+               // \8eÀ\8ds\92\86\82Í\8eÀ\8ds\95s\89Â
+               GetTitlePictureAction.Enabled := not FWork;
+       end;
 end;
 
 procedure TEditorForm.GetTitlePictureActionExecute(Sender: TObject);
@@ -1865,9 +1862,10 @@ var
        memStream: TMemoryStream;
        tmpBoard: TBoard;
 begin
-        if FWork then
+       if FWork then
                Exit;
-        FWork := True;
+
+       FWork := True;
 
        InitIdHTTP(Indy);
        memStream := TMemoryStream.Create;
@@ -2001,12 +1999,13 @@ begin
        finally
                settingBody.Free;
                Screen.Cursor := crDefault;
+        FWork := False;
        end;
        if tmpBoard.IsHEADTXT then begin
-                ShowBoardHead(tmpboard, LocalEdit);
+                               ShowBoardHead(tmpboard, LocalEdit);
        end;
-         
-        FWork := False;
+
+
 end;
 
 procedure TEditorForm.CalcCapacityActionExecute(Sender: TObject);
@@ -2170,7 +2169,7 @@ begin
                end else if( AnsiPos(VAL_PON, val) > 0 ) then begin
                        ABoard.PON := Copy(val, AnsiPos(VAL_PON, val) + Length(VAL_PON), Length(val));
                end else begin
-                       ABoard.Cookie := val + '; ';
+                       ABoard.Cookie := ABoard.Cookie + val + '; ';
                end;
                //expires\82ð\90Ø\82è\8fo\82·
                val := Trim(GikoSys.GetTokenIndex(tmp, ';', 1));
@@ -2404,5 +2403,36 @@ begin
                form.Release;
        end;
 end;
+//! Cookie\8fî\95ñ\8dí\8f\9c
+procedure TEditorForm.ReleaseCookieActionExecute(Sender: TObject);
+var
+       Board : TBoard;
+begin
+       // \83X\83\8c\83b\83h\82ª\96³\82¢\81@\83X\83\8c\97§\82Ä\82Ì\82Æ\82«\82ÍFBoard\82ð\92¼\90Ú\8eg\82¤
+       if FThreadItem = nil then begin
+               Board := FBoard
+       end else begin
+               Board := FThreadItem.ParentBoard;
+       end;
+
+       // \83N\83b\83L\81[\82Ì\8fî\95ñ\82ð\8eÌ\82Ä\82é
+       Board.Cookie := '';
+       Board.SPID := '';
+       Board.PON  := '';
+       // 0\82É\8aª\82«\96ß\82·
+       Board.Expires := 0;
+end;
+//! \94Â\8fî\95ñ\8eæ\93¾Update\83C\83x\83\93\83g
+procedure TEditorForm.GetSETTINGTXTActionUpdate(Sender: TObject);
+begin
+       // \8eÀ\8ds\92\86\82Í\8eÀ\8ds\95s\89Â
+       GetSETTINGTXTAction.Enabled := not FWork;
+end;
+//! \83\8d\81[\83J\83\8b\83\8b\81[\83\8b\8eæ\93¾Update\83C\83x\83\93\83g
+procedure TEditorForm.GetHeadTXTActionUpdate(Sender: TObject);
+begin
+       // \8eÀ\8ds\92\86\82Í\8eÀ\8ds\95s\89Â
+       GetSETTINGTXTAction.Enabled := not FWork;
+end;
 
 end.