OSDN Git Service

Samba24対策機能の修正
authorh677 <h677>
Tue, 23 Mar 2004 15:46:33 +0000 (15:46 +0000)
committerh677 <h677>
Tue, 23 Mar 2004 15:46:33 +0000 (15:46 +0000)
Editor.dfm
Editor.pas

index 2fdfe37..0f86a37 100644 (file)
@@ -1532,6 +1532,7 @@ object EditorForm: TEditorForm
     Top = 124
   end
   object Timer1: TTimer
+    Enabled = False
     OnTimer = Timer1Timer
     Left = 233
     Top = 123
index 24e3410..0dfa251 100644 (file)
@@ -155,6 +155,7 @@ type
         procedure WriteSambaTime(const ATitle: string; ATime: TDateTime);
         function ReadSettingTime(const ATitle: string): Integer;
         function CheckSambaTime(const ATitle: string; ATime: TDateTime): Boolean;
+        procedure SetSamba24(const AURL: string; const ATitle: string);
        protected
                procedure CreateParams(var Params: TCreateParams); override;
        public
@@ -328,6 +329,7 @@ begin
        MailComboBox.Text := FBoard.KotehanMail;
        SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
        TitlePanel.Visible := True;
+    SetSamba24('','');
 end;
 
 procedure TEditorForm.SetThreadItem(Item: TThreadItem);
@@ -338,8 +340,7 @@ begin
        MailComboBox.Text := FThreadItem.ParentBoard.KotehanMail;
        SageCheckBox.Checked := AnsiPos('sage', MailComboBox.Text) <> 0;
        TitlePanel.Visible := False;
-    ReadSambaTime(Item.ParentBoard.Title);
-    StatusBar.Panels[2].Text := 'Samba24\8bK\92è\92l' + IntToStr(ReadSettingTime(Item.ParentBoard.Title));
+    SetSamba24(FThreadItem.ParentBoard.URL, FThreadItem.Title);
 end;
 
 procedure TEditorForm.SetFont;
@@ -892,7 +893,7 @@ begin
                        end;
                end else begin
             time := Now();
-            if ( AnsiPos('.2ch.', FThreadItem.ParentBoard.URL) = 0 ) and ( AnsiPos('.bbspink.', FThreadItem.ParentBoard.URL) = 0 ) then
+            if Timer1.Enabled = false then
                                Send(Board.SPID, Board.PON, True)
             else if CheckSambaTime(FThreadItem.ParentBoard.Title, time) then begin
                 WriteSambaTime(FThreadItem.ParentBoard.Title, time);
@@ -1194,5 +1195,14 @@ begin
                ReadSambaTime(FThreadItem.ParentBoard.Title);
 end;
 
+procedure TEditorForm.SetSamba24(const AURL: string; const ATitle: string);
+begin
+       if( AnsiPos('.2ch.', AURL) <> 0 ) or ( AnsiPos('.bbspink.', AURL) <> 0 ) then begin
+       Timer1.Enabled := true;
+           ReadSambaTime(ATitle);
+       StatusBar.Panels[2].Text := 'Samba24\8bK\92è\92l' + IntToStr(ReadSettingTime(ATitle));
+
+    end;
+end;
 end.