# Ignores private messages from user after he/she has been banned. # A lot of people think they would feel better if they offend operator # who has banned them. # Settings: ban_autoignore_time - time for which user messages # are ignored use strict; use vars qw($VERSION %IRSSI); use Irssi; $VERSION = '1.00'; %IRSSI = ( authors => 'V. V. Pavluk', contact => 'vladvic_r@mail.ru', name => 'Ban and ignore', description => 'This script ignores private ' . 'messages from users ' . 'after they have been banned.', license => 'Public Domain', ); my $ignoretime; sub read_setting { $ignoretime = Irssi::settings_get_time("ban_autoignore_time"); } sub temp_ignore { my ($data, $server, $witem) = @_; my @nicks = split/ +/, $data; foreach my $nick (@nicks) { next if $nick =~ /^#/; next if $nick =~ /^-/; Irssi::command("ignore -time $ignoretime $nick MSGS"); } Irssi::command_unbind("ban", 'temp_ignore'); $witem->command("ban $data"); Irssi::command_bind("ban", 'temp_ignore'); Irssi::signal_stop(); } Irssi::settings_add_time("misc", "ban_autoignore_time", 60); read_setting(); Irssi::command_bind("ban", 'temp_ignore'); Irssi::signal_add("setup changed", 'read_setting');