summaryrefslogtreecommitdiffstats
path: root/scripts/fnotify.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/fnotify.pl')
-rw-r--r--scripts/fnotify.pl20
1 files changed, 10 insertions, 10 deletions
diff --git a/scripts/fnotify.pl b/scripts/fnotify.pl
index 42a7eb8..76e46b4 100644
--- a/scripts/fnotify.pl
+++ b/scripts/fnotify.pl
@@ -51,7 +51,7 @@ $VERSION = '0.0.5';
#
sub priv_msg {
my ($server, $msg, $nick, $address, $target) = @_;
- my $msg_stripped = Irssi::strip_codes($msg);
+ my $msg_stripped = Irssi::strip_codes($msg);
my $network = $server->{tag};
filewrite('' . $network . ' ' . $nick . ' ' . $msg_stripped);
}
@@ -73,15 +73,15 @@ sub hilight {
#
sub filewrite {
my ($text) = @_;
- # FIXME: there is probably a better way to get the irssi-dir...
- my $fnfile = "$ENV{HOME}/.irssi/fnotify";
- if (!open(FILE, ">>", $fnfile)) {
- print_err("cannot open $fnfile: $!");
- }
- print FILE $text . "\n";
- if (!close(FILE)) {
- print_err("cannot close $fnfile: $!");
- }
+ my $fnfile = Irssi::get_irssi_dir() . "/fnotify";
+ if (!open(FILE, ">>", $fnfile)) {
+ print CLIENTCRAP "Error: cannot open $fnfile: $!";
+ } else {
+ print FILE $text . "\n";
+ if (!close(FILE)) {
+ print CLIENTCRAP "Error: cannot close $fnfile: $!";
+ }
+ }
}
#