From: Ian Jackson Date: Mon, 10 Jun 2002 01:13:01 +0000 (+0000) Subject: watching you X-Git-Url: https://git.distorted.org.uk/~mdw/ircbot/commitdiff_plain/178ab287dc9815b66317929ed798049402a980b2?hp=9d6128b9226b4241a711b64748c3817d9265b5ab watching you --- diff --git a/ledhelp b/ledhelp index b5ba083..e94f74d 100644 --- a/ledhelp +++ b/ledhelp @@ -1,7 +1,10 @@ : Commands: - reload reload configuration from - help display this help + who report on which channels are reported where + reload reload configuration from + debug ... turn on debugging (causes lag!) + nodebug turn off debugging + help display this help See http://... for full information diff --git a/ledmodule.tcl b/ledmodule.tcl index f95ff21..8059f00 100644 --- a/ledmodule.tcl +++ b/ledmodule.tcl @@ -144,6 +144,7 @@ proc_mon gotchanlist {ch nll} { foreach nl $nll { if {![string compare $nl [irctolower $nick]]} continue if {[mon_nick_is $mm(nopresence) $nl]} continue + if {[mon_nick_is $mm(ignore) $nl]} continue lappend l $nl } ldebug m$m "$ch names: $l" @@ -528,6 +529,11 @@ def_ucmd nodebug { reporterr "debug disabled by $n" } +proc_dset visibledest { + regexp {^[^:]*\:[^:]*} $dd(group) dest + return $dest +} + def_ucmd who { set r {} foreach m [list_objs monitor] { @@ -536,8 +542,7 @@ def_ucmd who { } foreach d [list_objs deviceset] { upvar #0 deviceset/$d dd - regexp {^[^:]*\:[^:]*} $dd(group) dest - lappend r "sending $dd(monname) to $dest" + lappend r "sending $dd(monname) to [dset_visibledest $d]" } ucmdr [join $r "\n"] {} } @@ -551,11 +556,34 @@ proc connected {} { config_change } -proc msg_JOIN {p c chan} { chan_shortly $chan } +proc warn_pref {n} { + set nl [irctolower $n] + set l {} + foreach m [list_objs monitor] { + upvar #0 monitor/$m mm + if {![mon_nick_is $mm(prefer) $n]} continue + append l $m + } + foreach d [list_objs deviceset] { + upvar #0 deviceset/$d dd + if {[lsearch $l $dd(monname)]==-1} continue + append l [dset_visibledest $d] + } + if {[llength $l]} { + sendprivmsg $nl "LEDs are watching you: [join $l " "]" + } +} + +proc msg_JOIN {p c chan} { + prefix_nick + set nl [irctolower $n] + chan_shortly $chan + warn_pref $n +} proc msg_PART {p c chan} { chan_shortly $chan } proc msg_KILL {p c user why} { allchans_shortly } proc msg_QUIT {p c why} { allchans_shortly } -proc msg_NICK {p c newnick} { allchans_shortly } +proc msg_NICK {p c newnick} { allchans_shortly; warn_pref $newnick } proc msg_KICK {p c chans users comment} { if {[llength $chans] > 1} { allchans_shortly