diff options
author | Paul W. Frields <stickster@gmail.com> | 2007-01-28 02:48:16 +0000 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2007-01-28 02:48:16 +0000 |
commit | 83c6dedd01db29189b1afb5ff332b59fb9932c8e (patch) | |
tree | 753768568117c69073c0dd6747e9801791b4bffa | |
parent | 72924f8ffc2fc7a72e6a68e5626de6f932204191 (diff) | |
download | irssi-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.pl | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; $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 { |