summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-19 17:28:34 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-19 17:28:34 +0000
commit0d4de36c6e62b574c383cf6e43781aa1c531e2f2 (patch)
tree7b1b9078b4d355f7f134ec7b633d642e2efa29ce /scripts
parente746a0b679bd3148974921f38d20e92efdbe14ac (diff)
downloadirssi-0d4de36c6e62b574c383cf6e43781aa1c531e2f2.zip
Randomizes the quit msg only if it wasn't given.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1853 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts')
-rw-r--r--scripts/quitmsg.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/quitmsg.pl b/scripts/quitmsg.pl
index 17bf9444..1a946a19 100644
--- a/scripts/quitmsg.pl
+++ b/scripts/quitmsg.pl
@@ -1,4 +1,5 @@
-# Quit with a random quit message read from ~/.irssi/irssi.quit
+# If quit message isn't given, quit with a random message
+# read from ~/.irssi/irssi.quit
use Irssi;
use Irssi::Irc;
@@ -8,6 +9,7 @@ my $quitfile = glob "~/.irssi/irssi.quit";
sub cmd_quit {
my ($data, $server, $channel) = @_;
+ return if ($data eq "");
open (f, $quitfile) || return;
my $lines = 0; while(<f>) { $lines++; };