X-Git-Url: https://git.distorted.org.uk/~mdw/ircbot/blobdiff_plain/bb72ec7b3d1a2cac3c26fea0c812c17f5559b478..2d284dbcc988527c76deb441d010f26951997e33:/irccore.tcl diff --git a/irccore.tcl b/irccore.tcl index c3ee544..545446c 100644 --- a/irccore.tcl +++ b/irccore.tcl @@ -5,6 +5,7 @@ proc defset {varname val} { # must set host defset port 6667 +defset socketargs {} defset nick testbot defset ident blight @@ -247,6 +248,13 @@ proc check_nick {n} { if {[string length $n] > 18} { error "nick too long" } } +proc check_chan {n} { + if {![regsub {^\#} $n {} n]} { error "bad chan start" } + if {[regexp -nocase {[^][\\`_^{|}a-z0-9-]} $n]} { error "bad char in chan" } + if {[regexp {^[-0-9]} $n]} { error "bad chan name start" } + if {[string length $n] > 18} { error "chan name too long" } +} + proc ischan {dest} { return [regexp {^[&#+!]} $dest] }