summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2007-01-28 02:48:16 +0000
committerPaul W. Frields <stickster@gmail.com>2007-01-28 02:48:16 +0000
commit83c6dedd01db29189b1afb5ff332b59fb9932c8e (patch)
tree753768568117c69073c0dd6747e9801791b4bffa
parent72924f8ffc2fc7a72e6a68e5626de6f932204191 (diff)
downloadirssi-notify-83c6dedd01db29189b1afb5ff332b59fb9932c8e.tar.gz
irssi-notify-83c6dedd01db29189b1afb5ff332b59fb9932c8e.tar.xz
irssi-notify-83c6dedd01db29189b1afb5ff332b59fb9932c8e.zip
Use the proper time from settings
git-svn-id: https://irssi-libnotify.googlecode.com/svn/trunk@26 291cbfae-0d27-0410-99d7-557b17e6fe3d
-rw-r--r--notify.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/notify.pl b/notify.pl
index 037c099..c87b02f 100644
--- a/notify.pl
+++ b/notify.pl
@@ -24,6 +24,13 @@ $VERSION = "0.2.0";
Irssi::settings_add_str('notify', 'notify_icon', 'gtk-dialog-info');
Irssi::settings_add_str('notify', 'notify_time', '5000');
+sub atoi {
+ my $t;
+ foreach my $d (split(//, shift())) {
+ $t = $t * 10 + $d;
+ }
+}
+
sub notify {
my ($server, $summary, $message) = @_;
my $bus = Net::DBus->session;
@@ -37,15 +44,15 @@ sub notify {
$message =~ s/</&lt;/g;
$message =~ s/>/&gt;/g;
$message =~ s/'/&apos;/g;
-
- $obj->Notify("notification.pl",
+
+ $obj->Notify("notify.pl",
0,
'',
$summary,
$message,
['Close', 'Close'],
{0, 0, 0},
- 5_000);
+ atoi(Irssi::settings_get_str('notify_time')));
}
sub print_text_notify {