#include "wildcard.h"
#include "commands/cmd_who.h"
-extern ServerConfig* Config;
-extern user_hash clientlist;
+extern InspIRCd* ServerInstance;
extern chan_hash chanlist;
extern std::vector<userrec*> all_opers;
/* XXX - code duplication; this could be more efficient -- w00t */
std::string wholine = initial;
- wholine = wholine + getlastchanname(i->second) + " " + i->second->ident + " " + (opt_showrealhost ? i->second->host : i->second->dhost) + " " +
+ wholine = wholine + ch->name + " " + i->second->ident + " " + (opt_showrealhost ? i->second->host : i->second->dhost) + " " +
i->second->server + " " + i->second->nick + " ";
/* away? */
}
else
{
- for (user_hash::iterator i = clientlist.begin(); i != clientlist.end(); i++)
+ for (user_hash::iterator i = ServerInstance->clientlist.begin(); i != ServerInstance->clientlist.end(); i++)
{
if (whomatch(i->second, matchtext, opt_realname, opt_showrealhost))
{
}
}
/* Send the results out */
- if ((whoresults.size() < (size_t)Config->MaxWhoResults) && (!opt_unlimit))
+ if ((whoresults.size() < (size_t)ServerInstance->Config->MaxWhoResults) && (!opt_unlimit))
{
for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++)
- WriteServ_NoFormat(user->fd,n->c_str());
- WriteServ(user->fd,"315 %s %s :End of /WHO list.",user->nick, parameters[0]);
+ user->WriteServ(*n);
+ user->WriteServ("315 %s %s :End of /WHO list.",user->nick, parameters[0]);
}
else
{
/* BZZT! Too many results. */
- WriteServ(user->fd,"315 %s %s :Too many results",user->nick, parameters[0]);
+ user->WriteServ("315 %s %s :Too many results",user->nick, parameters[0]);
}
}