use strict;
use vars qw($VERSION %IRSSI);

use Irssi;

$VERSION = '2.00';
%IRSSI = (
    authors	=> 'firetech',
    contact	=> 'firetech @ EFnet',
    name	=> 'bjarre2.pl',
    description	=> 'Replaces words in all messages sent to channels. Loosely based on bjarrelizer (bjarre.pl) by Mikachu and Yarrick',
    license	=> 'Public Domain',
);


sub replace_text {
    my (@replaces) = split (/ +/, Irssi::settings_get_str('bjarre2_replaces'));
	foreach my $replace (@replaces) {
		eval "\$_[0] =~ $replace;";
	}
	Irssi::signal_continue(@_);
}

Irssi::settings_add_str('misc', 'bjarre2_replaces', 's/bjarnevik/bjarre/g s/CCW\|?/CCPongPajp/g');
Irssi::signal_add('send text', 'replace_text');
