From b45d06f5d39b8707a3c0db17748dbeab23fa3ab3 Mon Sep 17 00:00:00 2001 From: eleksir Date: Fri, 30 Sep 2016 01:17:35 +0300 Subject: [PATCH] try not to loose notifications if notification-daemon stuck from notifications havoc --- hexchat-notification.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hexchat-notification.pl b/hexchat-notification.pl index 69cf03b..c5f93b4 100644 --- a/hexchat-notification.pl +++ b/hexchat-notification.pl @@ -29,10 +29,17 @@ sub hookfn { $text =~ s/\"/\\"/g; my $topic = sprintf("%s at %s says:\n", $nick, $channel); $active = 1; - threads->create(\¬ify, $topic, $text)->detach; + my $t = undef; + + do { + $t = threads->create(\¬ify, $topic, $text); + sleep 1 unless(defined($t)); + } unless (defined($t)); + + $t->detach; if ($active == 1) { - hook_timer( 100, \&timeraction); + hook_timer( 500, \&timeraction); } return EAT_NONE;