3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 12:12:34 +01:00

Capabilities: fix cap-overriding

This commit is contained in:
Pragmatic Software 2020-02-18 09:50:02 -08:00
parent cf7bb75c57
commit ec99b205e8

View File

@ -36,8 +36,13 @@ sub initialize {
sub has { sub has {
my ($self, $cap, $subcap, $depth) = @_; my ($self, $cap, $subcap, $depth) = @_;
my $cap_data = $self->{caps}->get_data($cap); my $cap_data = $self->{caps}->get_data($cap);
return 0 if not defined $cap_data; return 0 if not defined $cap_data;
return 1 if $cap eq $subcap and $cap_data->{$subcap};
if ($cap eq $subcap) {
return 0 if exists $cap_data->{$subcap} and not $cap_data->{$subcap};
return 1;
}
$depth //= 10; $depth //= 10;
if (--$depth <= 0) { if (--$depth <= 0) {