]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add <showwhois:showfromopers> setting, requested by MacGyver. Can be useful if you...
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 23 Oct 2008 21:48:13 +0000 (21:48 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 23 Oct 2008 21:48:13 +0000 (21:48 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10696 e03df62e-2008-0410-955e-edbf42e46eb7

conf/modules.conf.example
src/modules/m_showwhois.cpp

index 67d17fbfc87974a9fc3eda661c1cd7113e277f4d..4a7e05096d391dbf58d6f021443c54696795b4e6 100644 (file)
 # 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 
index fac5d124e1bf5f02cb45cd3cd65acad8600c2ab3..f4b7cec463b1323d8ae31a5b2fdaa536477df154 100644 (file)
@@ -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 + "@";