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;
	
	if ($server->{'chatnet'} eq 'Bitlbee' &&
		$nick eq 'root') {
		open(my $fh, '>>', 'hipchatyeehaw.txt') or die;
		# print $fh 'yeehaw' if ($text eq '');
		# print $fh 'boohoo' if (!defined($text));
		print $fh 'booya' if ($text =~ /^\s*$/);
		# print $fh $text . "\n";
		close $fh;
		
		if ($text eq '') {
			signal_stop();
		}
		else {
			# Modify the text
		}
	}
};

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

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) = @_;
	
	if ($server->{'chatnet'} eq 'Bitlbee' &&
		$nick eq 'root') {
		open(my $fh, '>>', 'hipchatyeehaw.txt') or die;
		# print $fh 'yeehaw' if ($text eq '');
		# print $fh 'boohoo' if (!defined($text));
		print $fh 'booya' if ($text =~ /^\s*$/);
		# print $fh $text . "\n";
		close $fh;
		
		if ($text eq '') {
			signal_stop();
		}
		else {
			# Modify the text
		}
	}
};

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

Delete old log file output code
Delete old log file output code

Since I was just using that to test the signal and see what kind of
input I was getting, this is no longer needed. Now that I know what's
going on we can write the actual code to do the work.
