public:
CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2)
{
+ allow_empty_last_param = false;
flags_needed = 'o';
syntax = "<nick> <newident>";
TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
{
User* dest = ServerInstance->FindNick(parameters[0]);
- if (!dest)
+ if ((!dest) || (dest->registered != REG_ALL))
{
user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
return CMD_FAILURE;
}
};
-
class ModuleChgIdent : public Module
{
CommandChgident cmd;
public:
ModuleChgIdent() : cmd(this)
{
- ServerInstance->AddCommand(&cmd);
}
- virtual ~ModuleChgIdent()
+ void init()
{
+ ServerInstance->Modules->AddService(cmd);
}
virtual Version GetVersion()
};
MODULE_INIT(ModuleChgIdent)
-