commit 6756637209c65761e1b5b429be7d3a37984922ba
parent 1bc4ae6647da72ffba1b701ee6c1578148073638
Author: Jaffa Cake <j4jackj@template.hostname>
Date: Mon, 11 Aug 2014 17:23:55 -0400
I don't know... except that it's awesome and LimitServ, while working, is also broken.
Diffstat:
3 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/core/0003-ts6.tcl b/core/0003-ts6.tcl
@@ -277,11 +277,22 @@ proc ::ts6::irc-main {sck} {
}
tnda set "nick/$::netname($sck)/[lindex $comd $num]" [lindex $comd 2]
tnda set "oper/$::netname($sck)/[lindex $comd $num]" $oper
- tnda set "ident/$::netname($sck)/[lindex $comd $num]" [lindex $comd 5]
- tnda set "vhost/$::netname($sck)/[lindex $comd $num]" [lindex $comd 6]
+ tnda set "ident/$::netname($sck)/[lindex $comd $num]" [lindex $comd 6]
+ tnda set "vhost/$::netname($sck)/[lindex $comd $num]" [lindex $comd 7]
callbind $sck conn "-" "-" [lindex $comd $num]
}
+ "ENCAP" {
+ switch -nocase -- [lindex $comd 3] {
+ "SASL" {
+ #don't bother
+ }
+ }
+ }
+
+ "TOPIC" {
+ callbind $sck topic "-" "-" [lindex $comd 2] [join $payload " "]
+ }
"QUIT" {
tnda set "login/$::netname($sck)/[lindex $comd 0]" ""
tnda set "nick/$::netname($sck)/[lindex $comd 0]" ""
@@ -290,6 +301,7 @@ proc ::ts6::irc-main {sck} {
tnda set "rhost/$::netname($sck)/[lindex $comd 0]" ""
tnda set "vhost/$::netname($sck)/[lindex $comd 0]" ""
foreach {chan _} [tnda get "userchan/[lindex $comd 0]"] {
+ callbind $sck part "-" "-" [ndadec $chan] [lindex $comd 0]
tnda set "userchan/[lindex $comd 0]/$chan" 0
}
}
diff --git a/modules/0001-eggcompat.tcl b/modules/0001-eggcompat.tcl
@@ -32,6 +32,11 @@ proc protectopcheck {mc ftp} {
proc autoopcheck {c f} {
puts stdout "$c $f"
+ if {[matchattr [tnda get "login/$::netname($::sock)/$f"] |k $c]} {
+ $::maintype putmode $::sock 77 $c +bb "*![tnda get "ident/$::netname($::sock)/$f"]@[tnda get "vhost/$::netname($::sock)/$f"] \$a:[tnda get "login/$::netname($::sock)/$f"]" [tnda get "channels/$::netname($::sock)/[ndaenc $c]/ts"]
+ $::maintype kick $::sock 77 $c $f "Autokicked (+k attribute)"
+ return
+ }
if {[matchattr [tnda get "login/$::netname($::sock)/$f"] n|] && [channel get $c operit]} {
$::maintype putmode $::sock 77 $c +[tnda get "pfx/owner"] $f [tnda get "channels/$::netname($::sock)/[ndaenc $c]/ts"]
return
@@ -289,12 +294,13 @@ proc msgchattr {from msg} {
foreach {c} [split $attrs {}] {
if {$c == "+"} {continue}
if {$c == "-"} {continue}
- if {$c == "v"} {set $c "mn|lmno"}
- if {$c == "l"} {set $c "mn|mno"}
- if {$c == "o"} {set $c "mn|omn"}
- if {$c == "m"} {set $c "mn|mn"}
- if {$c == "n"} {set $c "n|n"}
- if {$c == "a"} {set $c "mn|"}
+ if {$c == "k"} {set c "mn|mnol"}
+ if {$c == "v"} {set c "mn|lmno"}
+ if {$c == "l"} {set c "mn|mno"}
+ if {$c == "o"} {set c "mn|omn"}
+ if {$c == "m"} {set c "mn|mn"}
+ if {$c == "n"} {set c "n|n"}
+ if {$c == "a"} {set c "mn|"}
if {![matchattr [tnda get "login/$::netname($::sock)/$from"] $c $chan]} {
$::maintype notice $::sock 77 $from "You may only give flags you already possess (Any of flags $c required to set $attrs)."
return
diff --git a/modules/0004-limitserv.tcl b/modules/0004-limitserv.tcl
@@ -10,20 +10,20 @@ bind $::sock join "-" "-" limitservup
bind $::sock part "-" "-" limitservdown
bind $::sock pub "-" "!dolimit" limitservdochan
-#after 60000 {limitservdo}
+after 300000 {limitservdo}
proc limitservup {chan msg} {
set ndacname [string map {/ [} [::base64::encode [string tolower $chan]]]
if {""==[tnda get "limitserv/$::netname($::sock)/$ndacname"]} {set i 1} {set i [expr {[tnda get "limitserv/$::netname($::sock)/$ndacname"] + 1}]}
tnda set "limitserv/$::netname($::sock)/$ndacname" $i
- intlimitservdochan $chan
+# intlimitservdochan $chan
}
proc limitservdown {chan msg} {
set ndacname [string map {/ [} [::base64::encode [string tolower $chan]]]
if {""==[tnda get "limitserv/$::netname($::sock)/$ndacname"]} {set i 0} {set i [expr {[tnda get "limitserv/$::netname($::sock)/$ndacname"] - 1}]}
tnda set "limitserv/$::netname($::sock)/$ndacname" $i
- intlimitservdochan $chan
+# intlimitservdochan $chan
}
proc limitservjoin {chan ft} {
@@ -35,11 +35,9 @@ proc limitservjoin {chan ft} {
proc limitservdo {} {
foreach {chan is} [nda get "limitserv/regchan"] {
if {1!=$is} {continue}
- if {[tnda get "limitserv/$::netname($::sock)/$chan"] == [tnda get "limitserv/last/$::netname($::sock)/$chan"]} {continue}
$::maintype putmode $::sock 47 [::base64::decode [string map {[ /} $chan]] "+l" [expr {[tnda get "limitserv/$::netname($::sock)/$chan"] + 10}] [nda get "regchan/$chan/ts"]
- tnda set "limitserv/last/$::netname($::sock)/$chan" [tnda get "limitserv/$::netname($::sock)/$chan"]
}
- after 60000 {limitservdo}
+ after 300000 {limitservdo}
}
proc limitservdochan {cname msg} {
@@ -49,10 +47,10 @@ proc limitservdochan {cname msg} {
$::maintype privmsg $::sock 47 $cname "You must be at least halfop to manually trigger autolimit on the channel."
return
}
- $::maintype putmode $::sock 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock)/$chan"] + 10}] [nda get "regchan/$chan/ts"]
+ $::maintype putmode $::sock 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock)/$chan"] + 14}] [nda get "regchan/$chan/ts"]
}
proc intlimitservdochan {cname} {
set chan [string map {/ [} [::base64::encode [string tolower $cname]]]
- $::maintype putmode $::sock 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock)/$chan"] + 10}] [nda get "regchan/$chan/ts"]
+ $::maintype putmode $::sock 47 $cname "+l" [expr {[tnda get "limitserv/$::netname($::sock)/$chan"] + 14}] [nda get "regchan/$chan/ts"]
}