mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
Add <showwhois:showfromopers> setting, requested by MacGyver. Can be useful if you don't want suspicious people to know you're watching them.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10696 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
1200d6285b
commit
0f41486ecf
@ -1376,7 +1376,11 @@
|
||||
# users/auspex priv will see real hosts of people, though. This setting
|
||||
# is not reloadable via /rehash, and will require /reloadmodule, as
|
||||
# it directly affects the mode object itself.
|
||||
#<showwhois opersonly="yes">
|
||||
#<showwhois opersonly="yes"
|
||||
#
|
||||
# You may also set whether or not users should recieve whois notices, should
|
||||
# they be /whois'd by an oper.
|
||||
# showfromopers="yes">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Shun module: Provides the /shun command, which stops a user executing
|
||||
|
@ -47,7 +47,7 @@ class SeeWhois : public ModeHandler
|
||||
|
||||
class ModuleShowwhois : public Module
|
||||
{
|
||||
|
||||
bool ShowWhoisFromOpers;
|
||||
SeeWhois* sw;
|
||||
|
||||
public:
|
||||
@ -56,6 +56,7 @@ class ModuleShowwhois : public Module
|
||||
{
|
||||
ConfigReader conf(ServerInstance);
|
||||
bool OpersOnly = conf.ReadFlag("showwhois", "opersonly", 0, true);
|
||||
ShowWhoisFromOpers = conf.ReadFlag("showwhois", "showfromopers", 0, true);
|
||||
|
||||
sw = new SeeWhois(ServerInstance, OpersOnly);
|
||||
if (!ServerInstance->Modes->AddMode(sw))
|
||||
@ -79,6 +80,9 @@ class ModuleShowwhois : public Module
|
||||
{
|
||||
if ((dest->IsModeSet('W')) && (source != dest))
|
||||
{
|
||||
if (!ShowWhoisFromOpers && IS_OPER(source))
|
||||
return;
|
||||
|
||||
std::string wmsg = "*** ";
|
||||
wmsg += source->nick + "(" + source->ident + "@";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user