2003.07.27 (日) 17:27:19 <Heracules> 241ベースからの移植です。
shuusei211107:日本語チャンネル名を使用可能にした(shuusei24138参照)
diff --dos -urN 211106/mainform.pas 211107/mainform.pas --- 211106/mainform.pas Sun Jul 27 16:49:45 2003 +++ 211107/mainform.pas Sun Jul 27 17:01:40 2003 @@ -1526,6 +1526,7 @@ mx3_auto_im:=ini.ReadBool('Other','MX3AutoIMEnabled',false); mx3_auto_im_text:=ini.ReadString('Other','MX3AutoIM','WinMX v3では一部機能に制限が出ます。'); id_2byte_enabled:=ini.ReadBool('Other2','Allow2ByteID',true); + channel_2byte_enabled:=ini.ReadBool('Other2','Allow2ByteChannel',true); restrict_searchresult_per_user:=ini.ReadBool('Other','RestrictSearchResultPerUser',false); max_searchresult_per_user:=ini.ReadInteger('Other','MaxSearchResultPerUser',5); toami_bantime:=ini.ReadInteger('Other','ToamiBanTime',3600); --- 211106/handler.pas Sun Jul 27 13:20:06 2003 +++ 211107/handler.pas Sun Jul 27 16:32:44 2003 @@ -998,6 +998,8 @@ LoginError(GetLangT(LNG_INVALIDARGS)); exit; end; + if AnsiPos('$1',hlist.Strings[0])<>0 then + LoginError(GetLangT(LNG_INVALIDNICK2, hlist.Strings[0])); tmp_pos:=191; if not CheckRange(hlist.Strings[4],0,10) then begin diff --dos -urN 211106/channels.pas 211107/channels.pas --- 211106/channels.pas Thu Jan 23 17:04:46 2003 +++ 211107/channels.pas Sun Jul 27 16:59:20 2003 @@ -441,11 +441,11 @@ begin Result:=nil; if db_channels=nil then exit; - channel:=lowercase(channel); + channel:=AnsiLowerCase(channel); for i:=0 to db_channels.count-1 do begin ch:=db_channels.Items[i]; - if lowercase(ch.channel)=channel then + if AnsiLowerCase(ch.channel)=channel then begin Result:=ch; exit; diff --dos -urN 211106/settings.pas 211107/settings.pas --- 211106/settings.pas Sun Jul 27 15:45:12 2003 +++ 211107/settings.pas Sun Jul 27 17:19:02 2003 @@ -579,6 +579,7 @@ cb_mx3_auto_IM: TCheckBox; edit_mx3_auto_IM: TEdit; cb_2byte_id_enabled: TCheckBox; + cb_2byte_channel_enabled: TCheckBox; procedure Panel3Resize(Sender: TObject); procedure headerPaint(Sender: TObject); procedure SetTopText(str: String); @@ -1499,6 +1500,7 @@ edit_allow_sign3.Visible:=cb_allow_other.Checked; edit_allow_sign4.Visible:=cb_allow_other.Checked; cb_2byte_id_enabled.Checked:=id_2byte_enabled; + cb_2byte_channel_enabled.Checked:=channel_2byte_enabled; end; procedure TSlavaNapSettings.sh_reportShow(Sender: TObject); @@ -2007,6 +2009,7 @@ allowed_custom[3]:=edit_allow_sign3.Text; allowed_custom[4]:=edit_allow_sign4.Text; id_2byte_enabled:=cb_2byte_id_enabled.Checked; + channel_2byte_enabled:=cb_2byte_channel_enabled.Checked; except end else if pages.ActivePage=sh_report then try diff --dos -urN 211106/settings.dfm 211107/settings.dfm --- 211106/settings.dfm Sun Jul 27 15:39:30 2003 +++ 211107/settings.dfm Sun Jul 27 17:14:10 2003 @@ -5672,7 +5672,7 @@ Width = 66 Height = 20 Style = csDropDownList - ItemHeight = 12 + ItemHeight = 0 TabOrder = 5 end object Panel4: TPanel @@ -5723,7 +5723,7 @@ Width = 66 Height = 20 Style = csDropDownList - ItemHeight = 12 + ItemHeight = 0 TabOrder = 7 end object Panel5: TPanel @@ -5783,7 +5783,7 @@ Width = 66 Height = 20 Style = csDropDownList - ItemHeight = 12 + ItemHeight = 0 TabOrder = 10 end object cb_loginblock_port: TCheckBox @@ -5993,6 +5993,14 @@ Height = 17 Caption = '2バイト文字のユーザーIDへの使用を認める' TabOrder = 16 + end + object cb_2byte_channel_enabled: TCheckBox + Left = 8 + Top = 120 + Width = 257 + Height = 17 + Caption = '2バイト文字のチャンネル名への使用を認める' + TabOrder = 17 end end end diff --dos -urN 211106/stypes.pas 211107/stypes.pas --- 211106/stypes.pas Sun Jul 27 16:08:58 2003 +++ 211107/stypes.pas Sun Jul 27 17:12:22 2003 @@ -1274,16 +1274,23 @@ Delete(str,i,1); i:=pos('"',str); end; - for i:=Length(str) downto 1 do - if (Ord(str[i])<33) or (Ord(str[i])>122) then - Delete(str,i,1); + if channel_2byte_enabled then + begin + for i:=Length(str) downto 1 do + if str[i]<' ' then + Delete(str,i,1); + end + else + for i:=Length(str) downto 1 do + if (Ord(str[i])<33) or (Ord(str[i])>122) then + Delete(str,i,1); if Length(str)>32 then str:=Copy(str,1,32); if pos('#',Copy(str,2,max_channel_name))>0 then exit; - if str='#' then str:=''; - if channels_irc then - if Length(str)>0 then - if str[1]<>'#' then str:='#'+str; - if channels_low then str:=lowercase(str); +// if str='#' then str:=''; +// if channels_irc then +// if Length(str)>0 then +// if str[1]<>'#' then str:='#'+str; + if channels_low then str:=AnsiLowerCase(str); Result:=str; end; diff --dos -urN 211106/vars.pas 211107/vars.pas --- 211106/vars.pas Sun Jul 27 15:44:48 2003 +++ 211107/vars.pas Sun Jul 27 17:00:42 2003 @@ -274,6 +274,7 @@ toami_taiou: String; renqueue_taiou: String; id_2byte_enabled: Boolean; + channel_2byte_enabled: Boolean; // bandwith limits bandwidth_up, bandwidth_down, bandwidth_maxup, bandwidth_maxdown, bandwidth_allowedup, bandwidth_alloweddown: Integer; bandwidth_limitservers, bandwidth_limited: Boolean;