mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-23 02:24:25 +01:00
Remove channel when last admin is removed
This commit is contained in:
parent
9614933b0e
commit
0687495bfb
@ -76,6 +76,11 @@ sub remove_admin {
|
||||
my ($channel, $hostmask) = @_;
|
||||
|
||||
my $admin = delete $self->{admins}->hash->{$channel}->{$hostmask};
|
||||
|
||||
if (not keys %{$self->{admins}->hash->{$channel}}) {
|
||||
delete $self->{admins}->hash->{$channel};
|
||||
}
|
||||
|
||||
if(defined $admin) {
|
||||
$self->{pbot}->{logger}->log("Removed level $admin->{level} admin [$admin->{name}] [$hostmask] from channel [$channel]\n");
|
||||
$self->save_admins;
|
||||
|
Loading…
Reference in New Issue
Block a user