+ bool allowconnect;
+ bool allowtags;
+ bool notifyuser;
+
+ bool IsShunned(LocalUser* user)
+ {
+ // Exempt the user if they are not fully connected and allowconnect is enabled.
+ if (allowconnect && user->registered != REG_ALL)
+ return false;
+
+ // Exempt the user from shuns if they are an oper and affectopers is disabled.
+ if (!affectopers && user->IsOper())
+ return false;
+
+ // Exempt the user from shuns if they are an oper with the servers/ignore-shun privilege.
+ if (user->HasPrivPermission("servers/ignore-shun"))
+ return false;
+
+ // Check whether the user is actually shunned.
+ return ServerInstance->XLines->MatchesLine("SHUN", user);
+ }