]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_who.cpp
ThreadEngine: remove excessive mutex use on thread creation
[user/henk/code/inspircd.git] / src / commands / cmd_who.cpp
index 4f44fd5182ed51605e7adcea4060c7be1ccd7c7e..718eb20020b3078e6d0f24d1b214ffe99493d547 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -250,25 +250,30 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                        opt_realname = true;
                                        break;
                                case 'm':
-                                       opt_mode = true;
+                                       if (user->HasPrivPermission("users/auspex"))
+                                               opt_mode = true;
                                        break;
                                case 'M':
-                                       opt_metadata = true;
+                                       if (user->HasPrivPermission("users/auspex"))
+                                               opt_metadata = true;
                                        break;
                                case 'i':
                                        opt_ident = true;
                                        break;
                                case 'p':
-                                       opt_port = true;
+                                       if (user->HasPrivPermission("users/auspex"))
+                                               opt_port = true;
                                        break;
                                case 'a':
                                        opt_away = true;
                                        break;
                                case 'l':
-                                       opt_local = true;
+                                       if (user->HasPrivPermission("users/auspex") || !*ServerInstance->Config->HideWhoisServer)
+                                               opt_local = true;
                                        break;
                                case 'f':
-                                       opt_far = true;
+                                       if (user->HasPrivPermission("users/auspex") || !*ServerInstance->Config->HideWhoisServer)
+                                               opt_far = true;
                                        break;
                                case 't':
                                        opt_time = true;
@@ -286,10 +291,10 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                if (CanView(ch,user))
                {
                        bool inside = ch->HasUser(user);
-       
+
                        /* who on a channel. */
                        CUList *cu = ch->GetUsers();
-       
+
                        for (CUList::iterator i = cu->begin(); i != cu->end(); i++)
                        {
                                /* None of this applies if we WHO ourselves */
@@ -298,12 +303,12 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                        /* opers only, please */
                                        if (opt_viewopersonly && !IS_OPER(i->first))
                                                continue;
-       
+
                                        /* If we're not inside the channel, hide +i users */
                                        if (i->first->IsModeSet('i') && !inside && !user->HasPrivPermission("users/auspex"))
                                                continue;
                                }
-       
+
                                SendWhoLine(user, initial, ch, i->first, whoresults);
                        }
                }
@@ -362,4 +367,3 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                return CMD_FAILURE;
        }
 }
-