use Irssi; sub sig_printtext { my ($dest, $text, $stripped) = @_; my ($window) = Irssi::window_find_name('hilight'); my ($target) = $dest->{target}; if ((($dest->{level} & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) && (!($target eq get_active_win())) && ($target =~ /^#.*/)) { if ($dest->{level} & MSGLEVEL_PUBLIC) { $text = "$target: $text"; } $window->print($text, MSGLEVEL_CLIENTCRAP) if ($window); } } sub get_active_win { my ($win) = Irssi::active_win(); return $win->get_active_name(); } Irssi::signal_add('print text', 'sig_printtext');