Notify config

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-08-12 10:46:30 +04:00
parent 52503dfebf
commit fa55cd636b
2 changed files with 8 additions and 4 deletions

View File

@ -24,6 +24,7 @@ sub load {
my $host = $config->{node}->{host}; my $host = $config->{node}->{host};
my @echoareas = split /,/, $config->{node}->{echoareas}; my @echoareas = split /,/, $config->{node}->{echoareas};
my $name = $config->{node}->{name}; my $name = $config->{node}->{name};
my $notify = $config->{notify}->{enabled};
$c = { $c = {
nick => $nick, nick => $nick,
@ -31,6 +32,7 @@ sub load {
host => $host, host => $host,
echoareas => [@echoareas], echoareas => [@echoareas],
name => $name, name => $name,
notify => $notify,
}; };
return $c; return $c;

View File

@ -148,8 +148,10 @@ sub get_echo {
# Notify # Notify
my @notify_cmd = ('notify-send', 'Сеть ii', 'Есть новые сообщения'); my @notify_cmd = ('notify-send', 'Сеть ii', 'Есть новые сообщения');
if ($notify == 1) {
system(@notify_cmd) == 0 or warn "Cannot send notify: $!\n"; system(@notify_cmd) == 0 or warn "Cannot send notify: $!\n";
} }
}
return $msgs; return $msgs;
} }