]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_who.cpp
Change OnHookUserIO to OnHookIO, making it usable for more than User* and less picky...
[user/henk/code/inspircd.git] / src / commands / cmd_who.cpp
index 1b77dd0047962721748caff6f6e135770eaee3ea..9e14ecb457ed8ec2ed98da1d4b71f1d26aac1b25 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.
@@ -81,7 +81,7 @@ bool CommandWho::whomatch(User* user, const char* matchtext)
                        irc::portparser portrange(matchtext, false);
                        long portno = -1;
                        while ((portno = portrange.GetToken()))
-                               if (portno == user->GetPort())
+                               if (portno == user->GetServerPort())
                                {
                                        match = true;
                                        break;
@@ -250,7 +250,8 @@ 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':
                                        if (user->HasPrivPermission("users/auspex"))
@@ -260,16 +261,19 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                        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;