]> jfr.im git - irc/SurrealServices/srsv.git/commitdiff
verdammt overcomplicated code, just so that
authortabris <redacted>
Tue, 14 Jun 2011 02:00:49 +0000 (02:00 +0000)
committertabris <redacted>
Tue, 14 Jun 2011 02:00:49 +0000 (02:00 +0000)
if user has neverop, but chan has autovoice,
user will have the pointy + crammed down their throat.

git-svn-id: http://svn.tabris.net/repos/srsv@3524 70d4eda1-72e9-0310-a436-91e5bd24443c

branches/0.4.3/modules/serviceslibs/chanserv.pm

index 1ce9c0fe440b61925f272a1b57fac4bcfd6ffe5b..8fed714cd076f5f31fcf52376da064e33c166811 100644 (file)
@@ -3690,12 +3690,20 @@ sub do_status($$;$) {
        if( !$check_only && is_registered($chan) &&
                !cr_chk_flag($chan, (CRF_CLOSE | CRF_DRONE)) )
        {
+               my $neverop = (is_neverop_user($user) || cr_chk_flag($chan, CRF_NEVEROP, 1));
+               my $no_deop = cr_chk_flag($chan, CRF_SPLITOPS, 0);
+               my $op_anyway = 0;
+               if($neverop && cr_chk_flag($chan, CRF_AUTOVOICE, 1) && $acc > 2) {
+                       $acc = 2;
+                       $no_deop = 0;
+                       $op_anyway = 1;
+               }
                set_modes($user, $chan, $acc,
                        # $acc == 3 is +h
                        # this probably needs to be configurable for ports
                        # also Unreal may [optionally] set +q on join.
-                       (($acc > 3) && cr_chk_flag($chan, CRF_SPLITOPS, 0)),
-                       !(is_neverop_user($user) || cr_chk_flag($chan, CRF_NEVEROP, 1)),
+                       $no_deop,
+                       !$neverop || $op_anyway,
                );
        }