Skip to content
Extraits de code Groupes Projets
Valider ce9449c5 rédigé par Aorimn's avatar Aorimn
Parcourir les fichiers

AJout du support des nouveaux chans modes

+q, +a, etc, qu'on traite de manière équivalente à +o pour les droits
d'administration
parent 0c22e359
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -274,7 +274,7 @@ sub parse_modes ...@@ -274,7 +274,7 @@ sub parse_modes
$chans{$chan}{"modes"}{$ch} = [shift @modes_changed]; $chans{$chan}{"modes"}{$ch} = [shift @modes_changed];
} }
} }
elsif($ch eq "v" || $ch eq "o") elsif($ch eq "v" || $ch eq "h" || $ch eq "o" || $ch eq "a" || $ch eq "q")
{ {
my $to_add = shift @modes_changed; my $to_add = shift @modes_changed;
if(defined $chans{$chan}{"modes"}{$ch}) if(defined $chans{$chan}{"modes"}{$ch})
...@@ -294,7 +294,7 @@ sub parse_modes ...@@ -294,7 +294,7 @@ sub parse_modes
} }
else else
{ {
if($ch eq "v" || $ch eq "o") if($ch eq "v" || $ch eq "h" || $ch eq "o" || $ch eq "a" || $ch eq "q")
{ {
if(defined $chans{$chan}{"modes"}{$ch}) if(defined $chans{$chan}{"modes"}{$ch})
{ {
...@@ -343,11 +343,20 @@ sub is_op ...@@ -343,11 +343,20 @@ sub is_op
return 0 unless defined($chan); return 0 unless defined($chan);
$chan = lc $chan; $chan = lc $chan;
return 0 unless(defined $chans{$chan}{"modes"}{"o"});
$user = $Config::nick unless(defined $user); $user = $Config::nick unless(defined $user);
return Common::is_in_list($chans{$chan}{"modes"}{"o"}, $user); my @o, @a, @q;
@o = Common::is_in_list($chans{$chan}{"modes"}{"o"}, $user)
if(defined $chans{$chan}{"modes"}{"o"});
@a = Common::is_in_list($chans{$chan}{"modes"}{"a"}, $user)
if(defined $chans{$chan}{"modes"}{"a"});;
@q = Common::is_in_list($chans{$chan}{"modes"}{"q"}, $user)
if(defined $chans{$chan}{"modes"}{"q"});;
return 1 if(@o or @a or @q);
return 0;
} # Fin is_op } # Fin is_op
...@@ -434,7 +443,7 @@ sub remove_quit_user ...@@ -434,7 +443,7 @@ sub remove_quit_user
# Qu'il soit sur le chan ou pas, osef # Qu'il soit sur le chan ou pas, osef
Common::removeall_from_list($chans{$chan}{"users"}, $user); Common::removeall_from_list($chans{$chan}{"users"}, $user);
my $modes = "-vo ".$user." ".$user; my $modes = "-vhoaq ".(($user.' ') x 5);
change_mode($chan, $modes); change_mode($chan, $modes);
} }
return 1; return 1;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter