1

try not to loose notifications if notification-daemon stuck from notifications havoc

This commit is contained in:
eleksir
2016-09-30 01:17:35 +03:00
parent 3112755e8c
commit b45d06f5d3

View File

@@ -29,10 +29,17 @@ sub hookfn {
$text =~ s/\"/\\"/g; $text =~ s/\"/\\"/g;
my $topic = sprintf("%s at %s says:\n", $nick, $channel); my $topic = sprintf("%s at %s says:\n", $nick, $channel);
$active = 1; $active = 1;
threads->create(\&notify, $topic, $text)->detach; my $t = undef;
do {
$t = threads->create(\&notify, $topic, $text);
sleep 1 unless(defined($t));
} unless (defined($t));
$t->detach;
if ($active == 1) { if ($active == 1) {
hook_timer( 100, \&timeraction); hook_timer( 500, \&timeraction);
} }
return EAT_NONE; return EAT_NONE;