From 83c6dedd01db29189b1afb5ff332b59fb9932c8e Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sun, 28 Jan 2007 02:48:16 +0000 Subject: Use the proper time from settings git-svn-id: https://irssi-libnotify.googlecode.com/svn/trunk@26 291cbfae-0d27-0410-99d7-557b17e6fe3d --- notify.pl | 13 ++++++++++--- 1 file 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//>/g; $message =~ s/'/'/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 { -- cgit