defset errchan #$nick
defset retry_after 900000
-defset chan_after 3000
+defset chan_after 1500
defset chans_retry 3600000
defset debug_reset_after 86400000
}
proc_mon gotchanlist {ch nll} {
+ global nick
if {[lsearch -exact $mm(chans) $ch] == -1} return
- set mm(present-$ch) $nll
+ set l {}
+ foreach nl $nll {
+ if {![string compare $nl [irctolower $nick]]} continue
+ if {[mon_nick_is $mm(nopresence) $nl]} continue
+ lappend $l $nl
+ }
+ set mm(present-$ch) $l
mon_updateall $m
}
set config_retry_after [after $chans_retry config_change]
}
+proc allchans_shortly {} {
+ global chan_after onchans shortly_alling
+ if {[info exists shortly_alling]} {
+ ldebug {} "global check already pending"
+ return
+ }
+ foreach ch [array names onchans] {
+ manyset $onchans($ch) status after
+ if {"$status" != "shortly"} continue
+ set idle
+ }
+ set shortly_alling [after $chan_after allchans_sendnames]
+}
+
+proc allchans_sendnames {} {
+ global shortly_alling
+ unset shortly_alling
+ ldebug {} "asking for global namelist"
+ sendout NAMES
+}
+
proc chan_shortly {ch} {
- global chan_after
+ global chan_after shortly_alling
+ set ch [irctolower $ch]
+ if {[info exists shortly_alling]} {
+ ldebug c$ch "global check already pending"
+ return
+ }
upvar #0 onchans($ch) oc
if {[info exists oc]} {
manyset $oc status after
proc msg_353 {p c dest type chan nicklist} {
set lchan [irctolower $chan]
set nll [irctolower $nicklist]
+ regsub -all {[=@*]} $nll {} nll
ldebug c$lchan "got names $nll"
foreach m [list_objs monitor] {
mon_gotchanlist $m $lchan $nll
config_change
}
-# JOIN PART
-# KICK KILL QUIT
+proc msg_JOIN {p c chan} { chan_shortly $chan }
+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_KICK {p c chans users comment} {
+ if {[llength $chans] > 1} {
+ allchans_shortly
+ } else {
+ chan_shortly [lindex $chans 0]
+ }
+}
if {[catch {
loadhelp