mirror of
https://github.com/anope/anope.git
synced 2026-07-02 03:06:38 +02:00
Fixed /os ignore, /os exception del, and a crash in /cs entrymsg
This commit is contained in:
@@ -146,7 +146,7 @@ class CommandOSIgnore : public Command
|
||||
private:
|
||||
void DoAdd(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
service_reference<IgnoreService> ignore_service("operserv/ignore");
|
||||
service_reference<IgnoreService> ignore_service("ignore");
|
||||
if (!ignore_service)
|
||||
return;
|
||||
|
||||
@@ -181,7 +181,7 @@ class CommandOSIgnore : public Command
|
||||
|
||||
void DoList(CommandSource &source)
|
||||
{
|
||||
service_reference<IgnoreService> ignore_service("operserv/ignore");
|
||||
service_reference<IgnoreService> ignore_service("ignore");
|
||||
if (!ignore_service)
|
||||
return;
|
||||
|
||||
@@ -205,7 +205,7 @@ class CommandOSIgnore : public Command
|
||||
|
||||
void DoDel(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
service_reference<IgnoreService> ignore_service("operserv/ignore");
|
||||
service_reference<IgnoreService> ignore_service("ignore");
|
||||
if (!ignore_service)
|
||||
return;
|
||||
|
||||
@@ -222,7 +222,7 @@ class CommandOSIgnore : public Command
|
||||
|
||||
void DoClear(CommandSource &source)
|
||||
{
|
||||
service_reference<IgnoreService> ignore_service("operserv/ignore");
|
||||
service_reference<IgnoreService> ignore_service("ignore");
|
||||
if (!ignore_service)
|
||||
return;
|
||||
|
||||
@@ -287,7 +287,7 @@ class OSIgnore : public Module
|
||||
|
||||
public:
|
||||
OSIgnore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
osignoreservice(this, "operserv/ignore"), commandosignore(this)
|
||||
osignoreservice(this, "ignore"), commandosignore(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
@@ -303,7 +303,7 @@ class OSIgnore : public Module
|
||||
{
|
||||
if (params.size() >= 4 && params[0].equals_ci("OS") && params[1].equals_ci("IGNORE"))
|
||||
{
|
||||
service_reference<IgnoreService> ignore_service("operserv/ignore");
|
||||
service_reference<IgnoreService> ignore_service("ignore");
|
||||
if (ignore_service)
|
||||
{
|
||||
const Anope::string &mask = params[2];
|
||||
|
||||
@@ -143,10 +143,11 @@ class ExceptionDelCallback : public NumberList
|
||||
|
||||
static void DoDel(CommandSource &source, unsigned index)
|
||||
{
|
||||
FOREACH_MOD(I_OnExceptionDel, OnExceptionDel(source.u, sessionservice->GetExceptions()[index]));
|
||||
Exception *e = sessionservice->GetExceptions()[index];
|
||||
FOREACH_MOD(I_OnExceptionDel, OnExceptionDel(source.u, e));
|
||||
|
||||
sessionservice->DelException(sessionservice->GetExceptions()[index]);
|
||||
delete sessionservice->GetExceptions()[index];
|
||||
sessionservice->DelException(e);
|
||||
delete e;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -72,10 +72,13 @@ class CommandEntryMessage : public Command
|
||||
try
|
||||
{
|
||||
unsigned i = convertTo<unsigned>(message);
|
||||
if (i <= messages.size())
|
||||
if (i > 0 && i <= messages.size())
|
||||
{
|
||||
messages.erase(messages.begin() + i - 1);
|
||||
ci->Extend("cs_entrymsg", new ExtensibleItemRegular<std::vector<EntryMsg> >(messages));
|
||||
if (!messages.empty())
|
||||
ci->Extend("cs_entrymsg", new ExtensibleItemRegular<std::vector<EntryMsg> >(messages));
|
||||
else
|
||||
ci->Shrink("cs_entrymsg");
|
||||
source.Reply(_("Entry message \2%i\2 for \2%s\2 deleted."), i, ci->name.c_str());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user