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

$VERSION = "0.1";

%IRSSI = (
    authors     => 'Tom Laermans (SiD3WiNDR)',
    contact     => 'sid3windr@sid3windr.be',
    name        => 'active-dcc',
    description => 'Shows DCC messages in active window',
    license     => 'GPL',
    url         => 'http://www.codemonkey.be',
);

sub dcc_move{

  my ($dest, $text, $stripped) = @_;
  my $server = $dest->{server};

  return if (!$server ||
             !($dest->{level} & MSGLEVEL_DCC) ||
             $server->ischannel($dest->{target}));

  my $awin = Irssi::active_win();
  $awin->print($text, MSGLEVEL_DCC);
  Irssi::signal_stop();
}

Irssi::signal_add('print text', 'dcc_move');
