Code: Select all
namespace eval IRcCloudCorrector {
bind mode - "% +b" [namespace current]::correct-irccloud
proc correct-irccloud {nick uhost hand chan mc ban} {
if {![botisop $chan]} { return 0 }
set userList [chanlist $chan]
foreach nxz $userList {
if {![matchaddr $ban $nxz![getchanhost $nxz $chan]]} continue
if {[isop $nxz $chan] || [ishalfop $nxz $chan] || [matchattr [nick2hand $nxz] "fnmo|fnmo" $chan]} { pushmode $chan -b $ban ; flushmode $chan ; continue }
if {[string match -nocase "*@*irccloud*" $ban]} { lappend kickList($chan) $nxz }
}
if {[info exists kickList($chan)]} {
foreach nxz $kickList($chan) {
set count [llength $kickList($chan)]
if {$count > 1} { pushmode $chan -b $ban ; flushmode $chan ; return 0
} else {
set chost [string trimleft [getchanhost $nxz $chan] "~"]
set ident [lindex [split $chost @] 0]
set xbmaskx [string map {sid id uid id} $ident]
set bmask *!*$xbmaskx@*
pushmode $chan +b $bmask
pushmode $chan -b $ban
}
flushmode $chan
}
}
}
}