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

use Irssi qw(signal_add signal_stop);
use Data::Dumper;

$VERSION = '1.00';
%IRSSI = (
	authors     => 'Teddy Wing',
	contact     => 'irssi@teddywing.com',
	name        => 'HipChat STFU',
	description => 'Silences annoying messages originating from HipChat.',
	license     => 'MIT',
);

sub test {
	my ($server, $text, $nick) = @_;
	
	my $filename = 'hipchat-stfu-output.txt';
	open(my $fh, '>>', $filename) or die;
	print $fh Dumper($server);
	print $fh "\t";
	print $fh $text;
	print $fh "\t";
	print $fh $nick;
	print $fh "\n";
	close $fh;
};

signal_add {
	'message public' => \&test,
};

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

use Irssi qw(signal_add signal_stop);
use Data::Dumper;

$VERSION = '1.00';
%IRSSI = (
	authors     => 'Teddy Wing',
	contact     => 'irssi@teddywing.com',
	name        => 'HipChat STFU',
	description => 'Silences annoying messages originating from HipChat.',
	license     => 'MIT',
);

sub hipchat_stfu {
	my ($server, $text, $nick) = @_;
	
	my $filename = 'hipchat-stfu-output.txt';
	open(my $fh, '>>', $filename) or die;
	print $fh Dumper($server);
	print $fh "\t";
	print $fh $text;
	print $fh "\t";
	print $fh $nick;
	print $fh "\n";
	close $fh;
};

signal_add {
	'message public' => \&hipchat_stfu,
};

Rename main sub to `hipchat_stfu`
Rename main sub to `hipchat_stfu`

`test` was just a temporary name to see if I could get the signal
working and to see what kind of information irssi would give me. Let's
use a more final name now that we know it works.
