but if someone has a special character in their nick
it doesn't always recognise them, I can't really see whats wrong
here, but maybe I've been looking at it for too long.
Code: Select all
proc adduserproc { nick address handle chan text } {
global priv lbn hub home group private
set ichan [string tolower $chan]
set pri private($ichan)
set type [string tolower [lindex $text 0]]
set usernick [lindex $text 1]
set user [nick2hand $usernick]
if {[onchan $usernick $chan]} {
if {[nick2hand [lindex $text 1]] == 0 } {
puthelp "PRIVMSG $chan :$usernick is not on $chan. or I can't recognise that user."
return 0
}
if {[validuser [nick2hand $user]] == 0 } {
puthelp "PRIVMSG $chan :$usernick is not on $chan. or I can't recognise that user."
return 0
}
if {[matchattr $user L] == 0 } {
puthelp "PRIVMSG $chan :I know $usernick, but $usernick isn't authed."
return 0
}
}
if {![onchan $usernick $chan]} {
set user $usernick
}
### Channel
if {$type == "owner" && [matchattr $handle m]} {
chattr $user |+nmofgv $chan
putserv "MODE $chan +v $usernick"
puthelp "PRIVMSG $chan :$usernick is now a channel $type for $chan!"
if {[info exists $pri] && [channel get $chan private]} {
if {$private(${ichan}) != "" } {
putserv "INVITE $usernick :$private(${ichan})"
}}}
if {$type == "master" && [matchattr $handle m|n $chan]} {
chattr $user |+mofgv-n $chan
putserv "MODE $chan +v $usernick"
puthelp "PRIVMSG $chan :$usernick is now a channel $type for $chan!"
if {[info exists $pri] && [channel get $chan private]} {
if {$private(${ichan}) != "" } {
putserv "INVITE $usernick :$private(${ichan})"
}}}
if {$type == "op"} {
chattr $user |+ofgv-nm $chan
putserv "MODE $chan +v $usernick"
puthelp "PRIVMSG $chan :$usernick is now a channel $type for $chan!"
if {[info exists $pri] && [channel get $chan private]} {
if {$private(${ichan}) != "" } {
putserv "INVITE $usernick :$private(${ichan})"
}}}
if {$type == "voice"} {
chattr $user |+fv-nmo $chan
putserv "MODE $chan +v $usernick "
puthelp "PRIVMSG $chan :$usernick is now a channel $type for $chan!"
}
where the flags are actually added and invites made.