+
+proc note_topic {showoff whoby topic} {
+ if {[string length $whoby]} {
+ set msg "FYI, $whoby has changed the topic on $showoff"
+ } else {
+ set msg "FYI, I have reset the topic on $showoff"
+ }
+ if {[string length $topic] < 160} {
+ append msg " to $topic"
+ } else {
+ append msg " but it is too long to reproduce here !"
+ }
+ set showoff [irctolower $showoff]
+ set tell [chandb_get $showoff topictell]
+ if {[lsearch -exact $tell *] >= 0} {
+ set tryspies [chandb_list]
+ } else {
+ set tryspies $tell
+ }
+puts "NT>showoff $showoff|whoby $whoby|topic $topic|tell $tell|tryspies $tryspies|msg $msg<"
+ foreach spy $tryspies {
+ set see [chandb_get $spy topicsee]
+puts "NT>spy $spy|see $see<"
+ if {[lsearch -exact $see $showoff] >= 0 || \
+ ([lsearch -exact $see *] >= 0 && \
+ [lsearch -exact $tell $spy] >= 0)} {
+ sendprivmsg $spy $msg
+ }
+ }
+}
+