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

use Irssi;
$VERSION = '1.0';
%IRSSI = (
	authors     => 'Mate ORY',
	contact     => 'orymate@ubuntu.com',
	name        => 'perper',
	description => 'Escapes messages beginning with /.',
	license     => 'GPL',
);

sub perper_hook {
	my ($msg, $serv, $chan) = @_;
    return unless ($chan and ($msg =~ m!^//!));
    my $channelname = $chan->{name};
    $msg =~ s/^\//\/MSG $channelname /;
    Irssi::signal_continue($msg, $serv, $chan);
}

Irssi::signal_add_first('send command', 'perper_hook');

