# --- Procs --- proc tsr:echo:msgm {nick uhost hand text} {tsr:echo:pubm $nick $uhost $hand "MSG" $text} proc tsr:echo:pubm {nick uhost hand chan text} { global echo echolist echochan echochannel echostrip echofilters listen if {$chan!="MSG"} { foreach tags [array names echolist] {set tag "" foreach mask $echolist($tags) {if {[string match $mask [string tolower $nick!$uhost]]} {set tag $tags; continue}} if {$tag!=""} { if {[lsearch [string tolower $listen($tag)] [string tolower $chan]]!=-1} { if {$echofilters($tag)} {set filters [tsr:echo:checkfilter [string tolower $tag] [string tolower [tsr:echo:strip:all $text]]]} else {set filters 1} foreach chans $echochan($tag) {if {$echostrip($chans)} {set text [tsr:echo:checkstrip $echostrip($chans) $text]}} if {$filters} { set put $echo(output); set put [str $put msg $text]; set put [str $put chan $chan]; set put [str $put nick $nick]; set put [str $put tag $tag] foreach echos $echochan($tag) {if {$echochannel([string tolower $echos])} {putchan $echos $put}} } } } } } }