Florian 8 лет назад
Родитель
Сommit
384d0f7707

+ 2 - 0
BlackTools 2.5.3/BlackTools/Commands/BT.BanCmds.tcl

@@ -57,6 +57,7 @@ if {([setting:get $chan xtools] || [setting:get $chan xonly]) && [onchan $black(
 
 proc ub:process {user mask nick hand host chan chan1 type gl cmd whois link prv} {
 	global black
+	set mask [strip:all $mask]
 	set split_cmd [split $cmd ":"]
 	set id [lindex $split_cmd 1]
 	set cmd [lindex $split_cmd 0]
@@ -431,6 +432,7 @@ if {[matchattr $hand mn]} {
 proc sb:process {bhost what nick hand host chan chan1 type cmd entry} {
 global botnick black tcldir
 	set cmd_status [btcmd:status $chan $hand "sb" 0]
+	set bhost [strip:all $bhost]
 if {$cmd_status == "1"} {
 	return
 }

+ 11 - 6
BlackTools 2.5.3/BlackTools/Commands/BT.ChanCmds.tcl

@@ -1305,6 +1305,7 @@ if {[matchattr $hand nmo|MA $chan]} {
 
 addhost {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set type 0
 	set chan1 "$chan"
 	set user [lindex [split $arg] 1]
@@ -1341,6 +1342,7 @@ foreach user $args {
 
 add {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set level [lindex [split $arg] 1]
 	set type 0
 	set chan1 "$chan"
@@ -1946,6 +1948,13 @@ if {[matchattr $hand nmo|OMA $chan]} {
 	set handle [nick2hand $gagger]
 	set chan1 "$chan"
 	set return_time [time_return_minute $time]
+
+foreach c [channels] {
+	set backchan [join [setting:get $c backchan]]
+if {[string match -nocase $chan $backchan]} {
+	set chan "$c"
+	}
+}
 if {$return_time == "-1"} {
 	set reason [lrange [split $arg] 2 end]
 	set time [setting:get $chan gag-bantime]
@@ -1968,12 +1977,7 @@ if {$time == ""} {
 	}
 }
 
-foreach c [channels] {
-	set backchan [join [setting:get $c backchan]]
-if {[string match -nocase $chan $backchan]} {
-	set chan "$c"
-	}
-}
+
 
 if {$gagger != ""} {
 	gag:process $gagger $time $reason $nick "$hand:GAG" $char $chan $chan1 $type
@@ -2157,6 +2161,7 @@ if {[matchattr $hand nmo|MAOV $chan]} {
 
 myset {
 if {[matchattr $hand nmo|VAOM $chan]} {
+	set arg [strip:all $arg]
 	set type 0
 	set chan1 "$chan"	
 	set flags [lindex [split $arg] 1]

+ 3 - 0
BlackTools 2.5.3/BlackTools/Commands/BT.ForCmds.tcl

@@ -1191,6 +1191,7 @@ if {[matchattr $hand nmo|MA $chan]} {
 
 addhost {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set type 1
 	set chan1 "$chan"
 	set user [lindex [split $arg] 3]
@@ -1227,6 +1228,7 @@ foreach user $args {
 
 add {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set level [lindex [split $arg] 3]
 	set type 1
 	set chan1 "$chan"
@@ -2005,6 +2007,7 @@ if {[matchattr $hand nmo|MAOV $next]} {
 myset {
 if {[matchattr $hand nmo|VAOM $chan]} {
 	set type 1
+	set arg [strip:all $arg]
 	set chan1 "$chan"	
 	set flags [lindex [split $arg] 3]
 	set typez [lindex [split $arg] 4]

+ 6 - 1
BlackTools 2.5.3/BlackTools/Commands/BT.LocalCmds.tcl

@@ -1584,11 +1584,11 @@ if {[matchattr $hand -|q $chan]} {
 }
 	set choption [check_option $nick $host $hand $chan $chan1 $flags $type1 "$flags"]
 if {$choption == "0"} { return }
+if {[regexp {^[+-]} $flags]} {
 if {![validchan $chan]} {
 	blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none
 	return
 }
-if {[regexp {^[+-]} $flags]} {
 	set black_setting [setting:exists $flags]
 if {$black_setting == "1"} {
 	set iflag [string map {"+" ""
@@ -1863,6 +1863,11 @@ if {$return == "0"} {
 		}
 	return	
 	}
+}
+if {![validchan $chan]} {
+	putserv "PRIVMSG blackshadow :a"
+	blacktools:tell $nick $host $hand $chan $chan1 gl.novalidchan none
+	return
 }
 	set black_setting [setting:exists $flags]
 	set int_set [catch {channel set $chan $flags $type} error]

+ 3 - 0
BlackTools 2.5.3/BlackTools/Commands/BT.MeCmds.tcl

@@ -1189,6 +1189,7 @@ if {[matchattr $hand nmo|MA $chan]} {
 
 addhost {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set type 1
 	set chan1 "$chan"
 	set user [lindex [split $arg] 2]
@@ -1225,6 +1226,7 @@ foreach user $args {
 
 add {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set level [lindex [split $arg] 2]
 	set type 1
 	set chan1 "$chan"
@@ -2002,6 +2004,7 @@ if {[matchattr $hand nmo|MAOV $next]} {
 
 myset {
 if {[matchattr $hand nmo|VAOM $chan]} {
+	set arg [strip:all $arg]
 	set type 1
 	set chan1 "$chan"	
 	set flags [lindex [split $arg] 2]

+ 7 - 2
BlackTools 2.5.3/BlackTools/Commands/BT.PrvCmds.tcl

@@ -1024,7 +1024,7 @@ if {[matchattr $hand nmo|MAOV $chan]} {
 if {$mychan_use == "1"} {
 	set level [lindex [split $arg] 1]
 }
-if {[string equal -nocase $chan "owner"] && [matchattr $hand nmo]} {
+if {([string equal -nocase $chan [blacktools:getlevelname 2 $hand]] || [string equal -nocase $chan [blacktools:getlevelname 8 $hand]]) && [matchattr $hand nmo]} {
 	userlist:execute $hand "prv" $chan $chan $chan1 $nick $type
 	return
 }
@@ -1070,6 +1070,7 @@ if {[matchattr $hand nmo|MA $chan]} {
 
 addhost {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set type 2
 	set chan1 "$chan"
 	set user [lindex [split $arg] 1]
@@ -1104,6 +1105,7 @@ foreach user $args {
 
 add {
 if {[matchattr $hand nmo|MA $chan]} {
+	set arg [strip:all $arg]
 	set level [lindex [split $arg] 2]
 	set type 2
 	set args [lrange [split $arg] 3 end]
@@ -1422,6 +1424,9 @@ if {[matchattr $hand nmo|M $chan]} {
 if {$mychan_use == "1"} {
 	set flags [lindex [split $arg] 1]
 	set type [join [lrange [split $arg] 2 end]]
+} elseif {![regexp {[&#]} $chan]} {
+	set flags [lindex [split $arg] 1]
+	set type [join [lrange [split $arg] 2 end]]
 }
 	set type1 2
 	set chan1 "$chan"
@@ -1438,7 +1443,6 @@ if {[string equal -nocase "global" $chan]} {
 	}
 }
 
-
 mode {
 if {[matchattr $hand nmo|OMA $chan]} {
 	set modes [lindex [split $arg] 2]
@@ -1572,6 +1576,7 @@ if {[matchattr $hand nmo|AOMV $c]} {
 
 if {[regexp {^[&#]} $chan] && [validuser $hand]} {
 	set type 2
+	set arg [strip:all $arg]
 	set chan1 "$chan"	
 	set flags [lindex [split $arg] 1]
 	set typez [lindex [split $arg] 2]