]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add support for the servers/ignore-shun privilege.
authorSadie Powell <sadie@witchery.services>
Sun, 29 Mar 2020 11:06:06 +0000 (12:06 +0100)
committerSadie Powell <sadie@witchery.services>
Sun, 29 Mar 2020 11:08:19 +0000 (12:08 +0100)
docs/conf/opers.conf.example
src/modules/m_shun.cpp

index 7cad2589c4306ef98637697b67ef6baa3f1d6751..67801ce31c4cb73af7bd5e51fc837428026cddcc 100644 (file)
@@ -38,6 +38,7 @@
      #   - users/ignore-noctcp: allows opers with this priv to send a CTCP to a +T user.
      #   - users/ignore-privdeaf: allows opers with this priv to message users with +D set.
      #   - users/sajoin-others: allows opers with this priv to /SAJOIN users other than themselves.
+     #   - servers/ignore-shun: allows opers with this priv to ignore shuns.
      #   - servers/use-disabled-commands: allows opers with this priv to use disabled commands.
      #   - servers/use-disabled-modes: allows opers with this priv to use disabled modes.
      #
index 6eaa6b47c79e14b31d27812c182590638c258eac..e75f18770f2840b29579f80e627ec496e468018d 100644 (file)
@@ -212,19 +212,13 @@ class ModuleShun : public Module, public Stats::EventListener
                if (validated)
                        return MOD_RES_PASSTHRU;
 
-               if (!ServerInstance->XLines->MatchesLine("SHUN", user))
-               {
-                       /* Not shunned, don't touch. */
-                       return MOD_RES_PASSTHRU;
-               }
-
-               if (!affectopers && user->IsOper())
-               {
-                       /* Don't do anything if the user is an operator and affectopers isn't set */
-                       return MOD_RES_PASSTHRU;
-               }
+               // Exempt the user from shuns if:
+               //   (1) They are an oper and affectopers is disabled.
+               //   (2) They have the servers/ignore-shun privilege.
+               if ((!affectopers && user->IsOper()) || user->HasPrivPermission("servers/ignore-shun"))
+                               return MOD_RES_PASSTHRU;
 
-               if (!ShunEnabledCommands.count(command))
+               if (ServerInstance->XLines->MatchesLine("SHUN", user) && !ShunEnabledCommands.count(command))
                {
                        if (NotifyOfShun)
                                user->WriteNotice("*** Command " + command + " not processed, as you have been blocked from issuing commands (SHUN)");