*/
class RemoveBase : public Command
{
- private:
bool& supportnokicks;
public:
channel = ServerInstance->FindChan(channame);
/* Fix by brain - someone needs to learn to validate their input! */
- if (!target || !channel)
+ if ((!target) || (target->registered != REG_ALL) || (!channel))
{
- user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), !target ? username.c_str() : channame.c_str());
+ user->WriteNumeric(ERR_NOSUCHNICK, "%s %s :No such nick/channel", user->nick.c_str(), !channel ? channame.c_str() : username.c_str());
return CMD_FAILURE;
}
CommandFpart cmd2;
bool supportnokicks;
-
public:
ModuleRemove() : cmd1(this, supportnokicks), cmd2(this, supportnokicks)
{
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- virtual void On005Numeric(std::string &output)
+ virtual void On005Numeric(std::map<std::string, std::string>& tokens)
{
- output.append(" REMOVE");
+ tokens["REMOVE"];
}
virtual void OnRehash(User* user)
supportnokicks = ServerInstance->Config->ConfValue("remove")->getBool("supportnokicks");
}
- virtual ~ModuleRemove()
- {
- }
-
virtual Version GetVersion()
{
return Version("Provides a /remove command, this is mostly an alternative to /kick, except makes users appear to have parted the channel", VF_OPTCOMMON | VF_VENDOR);
}
-
};
MODULE_INIT(ModuleRemove)