diff options
| author | Teddy Wing | 2015-06-13 21:48:27 -0400 |
|---|---|---|
| committer | Teddy Wing | 2015-06-13 21:48:27 -0400 |
| commit | 31553bb0c136945171a430fd7f38ca7200a0cd32 (patch) | |
| tree | 6b01fa943800d1f855cfc2cce9af0ec027524008 /hipchat-stfu.pl | |
| parent | 0370866db92e1916af5ee98acf948adc3916d545 (diff) | |
| download | irssi-hipchat-stfu-31553bb0c136945171a430fd7f38ca7200a0cd32.tar.bz2 | |
Fix test `message public` listener
Turns out I got the argument list wrong. The argument list I was using
was for a `command_bind` (based on the tutorial mentioned in
0370866db92e1916af5ee98acf948adc3916d545).
I wanted to make a signal listener for public messages. Looked up the
documentation and figured out the correct arguments.
Also fixed my log message printing to append to the file instead of
overwriting it for every message received (previously I only got the
last message posted in my log output).
Diffstat (limited to 'hipchat-stfu.pl')
| -rw-r--r-- | hipchat-stfu.pl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hipchat-stfu.pl b/hipchat-stfu.pl index 26f72c9..c3a8b7d 100644 --- a/hipchat-stfu.pl +++ b/hipchat-stfu.pl @@ -13,14 +13,16 @@ $VERSION = '1.00'; ); sub test { - my ($data, $server, $window_item) = @_; - return unless $window_item; - my $filename = 'hipchat-stfu-output.txt'; + my ($server, $text, $nick) = @_; - open(my $fh, '>', $filename) or die; - print $fh $data; - print $fh '-------###-------'; + my $filename = 'hipchat-stfu-output.txt'; + open(my $fh, '>>', $filename) or die; print $fh $server; + print $fh "\t"; + print $fh $text; + print $fh "\t"; + print $fh $nick; + print $fh "\n"; close $fh; }; |
