mirror of
https://github.com/anope/anope.git
synced 2026-07-01 16:46:38 +02:00
Send replies from fantasy commands back to the channel, this will be expanded on later
This commit is contained in:
@@ -20,26 +20,27 @@ class CommandOSModUnLoad : public Command
|
||||
{
|
||||
}
|
||||
|
||||
CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms)
|
||||
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
Anope::string mname = params[0];
|
||||
User *u = source.u;
|
||||
const Anope::string &mname = params[0];
|
||||
|
||||
Module *m = FindModule(mname);
|
||||
if (!m)
|
||||
{
|
||||
u->SendMessage(OperServ, OPER_MODULE_ISNT_LOADED, mname.c_str());
|
||||
source.Reply(OPER_MODULE_ISNT_LOADED, mname.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (!m->handle)
|
||||
{
|
||||
u->SendMessage(OperServ, OPER_MODULE_REMOVE_FAIL, m->name.c_str());
|
||||
source.Reply(OPER_MODULE_REMOVE_FAIL, m->name.c_str());
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (m->GetPermanent() || m->type == PROTOCOL)
|
||||
{
|
||||
u->SendMessage(OperServ, OPER_MODULE_NO_UNLOAD);
|
||||
source.Reply(OPER_MODULE_NO_UNLOAD);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
@@ -49,11 +50,11 @@ class CommandOSModUnLoad : public Command
|
||||
|
||||
if (status == MOD_ERR_OK)
|
||||
{
|
||||
u->SendMessage(OperServ, OPER_MODULE_UNLOADED, mname.c_str());
|
||||
source.Reply(OPER_MODULE_UNLOADED, mname.c_str());
|
||||
ircdproto->SendGlobops(OperServ, "%s unloaded module %s", u->nick.c_str(), mname.c_str());
|
||||
}
|
||||
else
|
||||
u->SendMessage(OperServ, OPER_MODULE_REMOVE_FAIL, mname.c_str());
|
||||
source.Reply(OPER_MODULE_REMOVE_FAIL, mname.c_str());
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user