* ---------------------------------------------------
*/
+#include "inspircd.h"
#include "configreader.h"
#include "users.h"
#include "modules.h"
else
{
if (opt_port)
- port = (user->GetPort() == ConvToInt(matchtext));
+ {
+ irc::portparser portrange(matchtext, false);
+ long portno = -1;
+ while ((portno = portrange.GetToken()))
+ if (portno == user->GetPort())
+ port = true;
+ }
else
{
if (opt_away)
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
{
return new cmd_who(Instance);
}
/* Execute items in fastest-to-execute first order */
/* Opers see all */
- if (*user->oper)
+ if (IS_OPER(user))
return true;
else if (!chan->IsModeSet('s') && !chan->IsModeSet('p'))
return true;
return;
std::string wholine = initial + (ch ? ch->name : lcn) + " " + u->ident + " " + (opt_showrealhost ? u->host : u->dhost) + " " +
- ((*ServerInstance->Config->HideWhoisServer && !*user->oper) ? ServerInstance->Config->HideWhoisServer : u->server) +
+ ((*ServerInstance->Config->HideWhoisServer && !IS_OPER(user)) ? ServerInstance->Config->HideWhoisServer : u->server) +
" " + u->nick + " ";
/* away? */
- if (*u->awaymsg)
+ if (IS_AWAY(u))
{
wholine.append("G");
}
}
/* oper? */
- if (*u->oper)
+ if (IS_OPER(u))
{
wholine.append("*");
}
opt_viewopersonly = true;
break;
case 'h':
- if (*user->oper)
+ if (IS_OPER(user))
opt_showrealhost = true;
break;
case 'u':
- if (*user->oper)
+ if (IS_OPER(user))
opt_unlimit = true;
break;
case 'r':
}
}
/* Send the results out */
- if ((whoresults.size() <= (size_t)ServerInstance->Config->MaxWhoResults) || opt_unlimit)
+ if ((ServerInstance->Config->MaxWhoResults && (whoresults.size() <= (size_t)ServerInstance->Config->MaxWhoResults)) || opt_unlimit)
{
for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++)
user->WriteServ(*n);