rendered paste body#!/usr/bin/perl -w
use strict;
use vars qw($VERSION %IRSSI);
# This file is partially based on rainbow.pl
$VERSION = "1";
%IRSSI = (
authors => 'Wilmer van der Gaast',
contact => 'lintux@lintux.cx,
name => 'Fake-Ignore',
license => 'GNU GPLv2 or later',
);
use Irssi;
use Irssi::Irc;
sub fignore {
my ($text, $server, $dest) = @_;
if (!$server || !$server->{connected}) {
Irssi::print("Not connected to server");
return;
}
return unless $dest;
if ($dest->{type} eq "CHANNEL" || $dest->{type} eq "QUERY") {
$text = `date +%H:%M:%S` . ' Ignoring ALL from ' . $text;
$text =~ s/[\n\r }+/ /gs;
$dest->command("/msg " . $dest->{name} . " " . $text );
}
}
Irssi::command_bind( "fignore", "fignore" );