mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Add a shun option to only apply when users are fully connected.
Closes #1825.
This commit is contained in:
parent
0365daef5e
commit
56b4dc61e4
@ -2185,6 +2185,9 @@
|
||||
# option is deprecated; you should instead give exempt
|
||||
# server operators the servers/ignore-shun privilege.
|
||||
#
|
||||
# allowconnect: Whether to only apply shuns to users who are fully
|
||||
# connected to the server.
|
||||
#
|
||||
# allowtags: Whether to allow client tags to be attached to enabled
|
||||
# commands.
|
||||
#
|
||||
@ -2201,6 +2204,7 @@
|
||||
#<shun enabledcommands="ADMIN OPER PING PONG QUIT PART JOIN"
|
||||
# cleanedcommands="AWAY PART QUIT"
|
||||
# affectopers="no"
|
||||
# allowconnect="no"
|
||||
# allowtags="no"
|
||||
# notifyuser="yes">
|
||||
|
||||
|
@ -156,11 +156,16 @@ class ModuleShun : public Module, public Stats::EventListener
|
||||
insp::flat_set<std::string, irc::insensitive_swo> cleanedcommands;
|
||||
insp::flat_set<std::string, irc::insensitive_swo> enabledcommands;
|
||||
bool affectopers;
|
||||
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;
|
||||
@ -222,6 +227,7 @@ class ModuleShun : public Module, public Stats::EventListener
|
||||
|
||||
affectopers = tag->getBool("affectopers", false);
|
||||
allowtags = tag->getBool("allowtags");
|
||||
allowconnect = tag->getBool("allowconnect");
|
||||
notifyuser = tag->getBool("notifyuser", true);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user