* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult Handle(const std::vector<std::string>& parameters, User *user);
- bool whomatch(User* user, const char* matchtext);
+ bool whomatch(User* cuser, User* user, const char* matchtext);
};
#endif
return star;
}
-bool CommandWho::whomatch(User* user, const char* matchtext)
+bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext)
{
bool match = false;
bool positive = false;
if (!match)
match = InspIRCd::Match(user->nick, matchtext);
- if (!match)
+ /* Don't allow server name matches if HideWhoisServer is enabled, unless the command user has the priv */
+ if (!match && (!*ServerInstance->Config->HideWhoisServer || cuser->HasPrivPermission("users/auspex")))
match = InspIRCd::Match(user->server, matchtext);
return match;
{
User* oper = *i;
- if (whomatch(oper, matchtext))
+ if (whomatch(user, oper, matchtext))
{
if (!user->SharesChannelWith(oper))
{
{
for (user_hash::iterator i = ServerInstance->Users->clientlist->begin(); i != ServerInstance->Users->clientlist->end(); i++)
{
- if (whomatch(i->second, matchtext))
+ if (whomatch(user, i->second, matchtext))
{
if (!user->SharesChannelWith(i->second))
{