diff options
-rw-r--r-- | notifyudp.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/notifyudp.pl b/notifyudp.pl index 9f878aa..6124b88 100644 --- a/notifyudp.pl +++ b/notifyudp.pl @@ -11,7 +11,7 @@ use IO::Socket; use vars qw($VERSION %IRSSI); use Time::HiRes qw(time); -$VERSION = "0.2.20130614"; +$VERSION = "0.3.20140930"; %IRSSI = ( authors => 'Lekensteyn', contact => 'lekensteyn@gmail.com', @@ -63,6 +63,12 @@ sub notify { } } } +sub notify_if_hilighted { + my ($dest, $text, $stripped) = @_; + if ($dest->{level} & MSGLEVEL_HILIGHT) { + notify(); + } +} sub notify_stop { if ($sock) { @@ -90,8 +96,8 @@ sub cmd_notifyudp { Irssi::command_bind('notifyudp', 'cmd_notifyudp'); my @signals = ( -#'print text', # too verbose? -'message public', +# Uncomment the following to get notifs for every (channel) message +#'message public', 'message private', 'dcc request', @@ -108,6 +114,7 @@ my @signals = ( 'ctcp msg', 'ctcp reply', ); +Irssi::signal_add('print text', 'notify_if_hilighted'); foreach (@signals) { Irssi::signal_add($_, 'notify'); } |