CmdResult Handle (const std::vector<std::string> ¶meters, User *user)
{
- std::string retbuf = std::string("340 ") + user->nick + " :";
+ std::string retbuf = "340 " + user->nick + " :";
int nicks = 0;
for (int i = 0; i < (int)parameters.size(); i++)
User *u = ServerInstance->FindNick(parameters[i]);
if ((u) && (u->registered == REG_ALL))
{
- retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=";
- if (IS_AWAY(u))
+ retbuf = retbuf + u->nick + (u->IsOper() ? "*" : "") + "=";
+ if (u->IsAway())
retbuf += "-";
else
retbuf += "+";
ModuleUserIP()
: cmd(this)
{
- ServerInstance->AddCommand(&cmd);
- Implementation eventlist[] = { I_On005Numeric };
- ServerInstance->Modules->Attach(eventlist, this, 1);
}
-
- virtual void On005Numeric(std::string &output)
+ void init()
{
- output = output + std::string(" USERIP");
+ ServerInstance->Modules->AddService(cmd);
+ Implementation eventlist[] = { I_On005Numeric };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- virtual ~ModuleUserIP()
+ virtual void On005Numeric(std::map<std::string, std::string>& tokens)
{
+ tokens["USERIP"];
}
virtual Version GetVersion()
{
return Version("Provides support for USERIP command",VF_VENDOR);
}
-
};
MODULE_INIT(ModuleUserIP)
-