2003.03.20 (木) 06:15:40 <u*j*2*6*> shuusei21115とおなじです
2003.03.20 (木) 06:25:23 <u*j*2*6*> 設定したBot名とおなじIDでのログインをブロックするようにしました(機能OFFのときでも)
shuusei24135:ログインしたユーザーにIMを送る機能(idea by Equs_AriEl?)

diff --dos -wurN 24134/constants.pas 24135/constants.pas
--- 24134/constants.pas	Wed Mar 19 16:11:16 2003
+++ 24135/constants.pas	Thu Mar 20 06:09:22 2003
@@ -27,8 +27,8 @@
  SLAVANAP_VERSION             = '2.4.1';
  SLAVANAP_BUILD               = '108';
  SLAVANAP_BUILD_DATE          = '24 January 2003';
- SLAVANAP_SHUUSEI             = '33';
- SLAVANAP_SHUUSEI_DATE        = '19 March 2003';
+ SLAVANAP_SHUUSEI             = '34';
+ SLAVANAP_SHUUSEI_DATE        = '20 March 2003';
  SLAVANAP_VERSION_SHORT       = SLAVANAP_TITLE+' '+SLAVANAP_VERSION;
  SLAVANAP_FULL                = SLAVANAP_TITLE+' '+SLAVANAP_VERSION+
                                 ' (build '+SLAVANAP_BUILD+
@@ -46,6 +46,7 @@
  def_channel_limit            = 100;
  def_ban_timeout              = (31*24*60*60);
  max_announcement             = 63;
+ MAX_LOGINIM                  = 63;
  // sockets
  MAX_LISTEN_SOCKET            = 7; // maximum listen sockets
  MAX_LISTEN_TRAPSOCKET        = 7; // maximum listen trapsockets
diff --dos -wurN 24134/handler.pas 24135/handler.pas
--- 24134/handler.pas	Wed Mar 19 04:47:02 2003
+++ 24135/handler.pas	Thu Mar 20 05:56:40 2003
@@ -1020,7 +1020,7 @@
  rec: TOnlineUser;
  user2: POnlineUser;
  reg: PRegisteredUser;
- str, bandata, tempnick: String;
+ str, bandata, tempnick, loginims: String;
  i: Integer;
  //sin: TSockAddrIn;
  ban: PBan;
@@ -1269,6 +1269,21 @@
  tmp_pos:=204;
  Handler_Motd;
  UserOnline(local);
+ tmp_pos:=12263;
+ if enable_loginim then
+ begin
+   if Pos('WinMX',local.software)<>0 then
+   begin
+     for i:=0 to max_loginim do
+       if loginim[i]<>'' then
+         loginims:=loginims+loginim[i]+#13#10;
+     local.Exec(MSG_CLIENT_PRIVMSG,loginimbot+' '+loginims);
+   end
+   else
+     for i:=0 to max_loginim do
+       if loginim[i]<>'' then
+         local.Exec(MSG_CLIENT_PRIVMSG,loginimbot+' '+loginim[i]);
+ end;
  tmp_pos:=205;
  local.Flush;
 end;
diff --dos -wurN 24134/mainform.pas 24135/mainform.pas
--- 24134/mainform.pas	Wed Mar 19 13:24:30 2003
+++ 24135/mainform.pas	Thu Mar 20 06:17:16 2003
@@ -1451,6 +1451,22 @@
   StrHash_Reset(blocked_transferport_list);
   SplitString(blocked_transferport,blocked_transferport_list);
   share_matchedfile_only:=ini.ReadBool('Other2','ShareMatchOnly',false);
+  for i:=0 to MAX_LOGINIM do
+   loginim[i]:='';
+  enable_loginim:=ini.ReadBool('Other2','EnableLoginIM',false);
+  loginimbot:=ini.ReadString('Other2','LoginIMBot','LoginIMBot');
+  StrHash_Reset(cons_friends); // use as temporary list while loading data
+  StrHash_LoadFromFile(cons_friends,ApplicationDir+'loginim');
+  t:=cons_friends.first;
+  i:=0;
+  while t<>nil do
+  begin
+   loginim[i]:=trim(t^.data);
+   if trim(t^.data)<>'' then
+    inc(i);
+   t:=t^.next;
+  end;
+  StrHash_Clear(cons_friends);
   // set up console
   LogStartup('mainform::loadconfig: setting up console user');
   cons_channels:=TMyList.Create;
@@ -1894,6 +1910,17 @@
   ini.WriteBool('Other2','BlockTransferPort',block_transferport);
   ini.WriteString('Other2','BlockedTransferPort',blocked_transferport);
   ini.WriteBool('Other2','ShareMatchOnly',share_matchedfile_only);
+  ini.WriteBool('Other2','EnableLoginIM',enable_loginim);
+  ini.WriteString('Other2','LoginIMBot',loginimbot);
+  list:=TMyStringList.Create;
+  for i:=0 to MAX_LOGINIM do
+   if loginim[i]<>'' then
+    list.Add(loginim[i]);
+  try
+   list.SaveToFile(ApplicationDir+'loginim');
+   except
+  end;
+  list.Free;
   finally
   ini.Free;
  end;
diff --dos -wurN 24134/settings.dfm 24135/settings.dfm
--- 24134/settings.dfm	Wed Mar 19 18:53:34 2003
+++ 24135/settings.dfm	Wed Mar 19 22:55:58 2003
@@ -5996,6 +5996,45 @@
         TabFontColor = clBlack
         BevelInner = bvNone
         BevelOuter = bvNone
+        object GroupBox1: TGroupBox
+          Left = 8
+          Top = 0
+          Width = 345
+          Height = 89
+          Caption = 'ログインしたユーザーにIMするBot'
+          TabOrder = 0
+          object Label155: TLabel
+            Left = 200
+            Top = 18
+            Width = 36
+            Height = 12
+            Caption = 'Bot名:'
+          end
+          object cb_enable_loginim: TCheckBox
+            Left = 8
+            Top = 16
+            Width = 65
+            Height = 17
+            Caption = 'Bot有効'
+            TabOrder = 0
+          end
+          object edit_loginimbot: TEdit
+            Left = 240
+            Top = 14
+            Width = 97
+            Height = 20
+            TabOrder = 1
+            Text = 'LoginIMBot'
+          end
+          object edit_loginim: TMemo
+            Left = 8
+            Top = 38
+            Width = 329
+            Height = 43
+            ScrollBars = ssVertical
+            TabOrder = 2
+          end
+        end
       end
     end
   end
diff --dos -wurN 24134/settings.pas 24135/settings.pas
--- 24134/settings.pas	Wed Mar 19 18:57:14 2003
+++ 24135/settings.pas	Thu Mar 20 05:38:00 2003
@@ -577,6 +577,11 @@
     edit_blocked_transferport: TEdit;
     cb_share_matchedfile_only: TCheckBox;
     sh_other3: TDFWTabSheetes;
+    GroupBox1: TGroupBox;
+    cb_enable_loginim: TCheckBox;
+    Label155: TLabel;
+    edit_loginimbot: TEdit;
+    edit_loginim: TMemo;
     procedure Panel3Resize(Sender: TObject);
     procedure headerPaint(Sender: TObject);
     procedure SetTopText(str: String);
@@ -1502,9 +1507,17 @@
 end;
 
 procedure TSlavaNapSettings.sh_other3Show(Sender: TObject);
+var
+  i: Integer;
 begin
  SetTopText('その他の設定3');
  SetChange(true);
+ cb_enable_loginim.Checked:=enable_loginim;
+ edit_loginimbot.Text:=loginimbot;
+ edit_loginim.Lines.Clear;
+ for i:=0 to MAX_LOGINIM do
+   if loginim[i]<>'' then
+     edit_loginim.Lines.Add(loginim[i]);
 end;
 
 procedure TSlavaNapSettings.sh_reportShow(Sender: TObject);
@@ -2046,6 +2059,13 @@
   except
  end else if pages.ActivePage=sh_other3 then
  try
+   enable_loginim:=cb_enable_loginim.Checked;
+   loginimbot:=edit_loginimbot.Text;
+   for i:=0 to max_loginim do
+     loginim[i]:='';
+   for i:=0 to edit_loginim.Lines.Count-1 do
+     if Trim(edit_loginim.Lines.Strings[i])<>'' then
+       loginim[i]:=Trim(edit_loginim.Lines.Strings[i]);
   except
  end;
  btn_restoreClick(nil);
diff --dos -wurN 24134/stypes.pas 24135/stypes.pas
--- 24134/stypes.pas	Wed Mar 19 04:44:42 2003
+++ 24135/stypes.pas	Thu Mar 20 06:06:14 2003
@@ -1196,6 +1196,7 @@
  if str='chanserv' then exit;
  if str='operator' then exit;
  if str='nickserv' then exit;
+ if str=lowercase(loginimbot) then exit;
  if not ignore then
  begin
    if str='leech'    then exit;
diff --dos -wurN 24134/vars.pas 24135/vars.pas
--- 24134/vars.pas	Wed Mar 19 13:28:06 2003
+++ 24135/vars.pas	Thu Mar 20 05:33:24 2003
@@ -322,6 +322,9 @@
  blocked_transferport: String;
  blocked_transferport_list: TStringHash;
  share_matchedfile_only: Boolean;
+ enable_loginim: Boolean;
+ loginimbot: String;
+ loginim: Array[0..MAX_LOGINIM] of String;
 implementation
 
 procedure CheckWindows;