1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 14:43:12 +02:00

Removed operserv:notifications in favor of log blocks, as well as some other notifiications

This commit is contained in:
Adam
2012-02-08 18:00:24 -05:00
parent 089c85b27e
commit 1bc8e2ab82
15 changed files with 52 additions and 100 deletions
+6 -2
View File
@@ -549,13 +549,17 @@ class OSDefcon : public Module
if (!Config->SessionLimitDetailsLoc.empty())
ircdproto->SendMessage(findbot(Config->OperServ), u->nick, "%s", Config->SessionLimitDetailsLoc.c_str());
u->Kill(Config->OperServ, "Defcon session limit exceeded");
++session->hits;
if (akills && Config->MaxSessionKill && session->hits >= Config->MaxSessionKill)
{
XLine x("*@" + u->host, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Defcon session limit exceeded", XLineManager::GenerateUID());
akills->Send(NULL, &x);
ircdproto->SendGlobops(findbot(Config->OperServ), "[DEFCON] Added a temporary AKILL for \2*@%s\2 due to excessive connections", u->host.c_str());
Log(findbot(Config->OperServ), "akill/defcon") << "[DEFCON] Added a temporary AKILL for \2*@" << u->host << "\2 due to excessive connections";
}
else
{
u->Kill(Config->OperServ, "Defcon session limit exceeded");
u = NULL; /* No guarentee u still exists */
}
}
}
+1 -1
View File
@@ -63,7 +63,7 @@ class MyForbidService : public ForbidService
else if (d->type == FT_EMAIL)
ftype = "email";
Log(LOG_NORMAL, Config->OperServ + "/forbid") << "Expiring forbid for " << d->mask << " type " << ftype;
Log(LOG_NORMAL, "expire/forbid") << "Expiring forbid for " << d->mask << " type " << ftype;
this->forbidData.erase(this->forbidData.begin() + i - 1);
delete d;
}
+3 -3
View File
@@ -30,7 +30,7 @@ class CommandOSModLoad : public Command
ModuleReturn status = ModuleManager::LoadModule(mname, u);
if (status == MOD_ERR_OK)
{
ircdproto->SendGlobops(source.owner, "%s loaded module %s", u->nick.c_str(), mname.c_str());
Log(LOG_ADMIN, u, this) << "to load module " << mname;
source.Reply(_("Module \002%s\002 loaded"), mname.c_str());
}
else if (status == MOD_ERR_EXISTS)
@@ -91,7 +91,7 @@ class CommandOSModReLoad : public Command
status = ModuleManager::LoadModule(mname, u);
if (status == MOD_ERR_OK)
{
ircdproto->SendGlobops(source.owner, "%s reloaded module %s", u->nick.c_str(), mname.c_str());
Log(LOG_ADMIN, u, this) << "to reload module " << mname;
source.Reply(_("Module \002%s\002 reloaded"), mname.c_str());
}
else
@@ -150,8 +150,8 @@ class CommandOSModUnLoad : public Command
if (status == MOD_ERR_OK)
{
Log(LOG_ADMIN, u, this) << "to unload module " << mname;
source.Reply(_("Module \002%s\002 unloaded"), mname.c_str());
ircdproto->SendGlobops(source.owner, "%s unloaded module %s", u->nick.c_str(), mname.c_str());
}
else
source.Reply(_("Unable to remove module \002%s\002"), mname.c_str());
+2 -2
View File
@@ -38,13 +38,13 @@ class CommandOSOLine : public Command
u2->SetMode(source.owner, UMODE_OPER);
u2->SendMessage(source.owner, _("You are now an IRC Operator."));
source.Reply(_("Operflags \002%s\002 have been added for \002%s\002."), flag.c_str(), nick.c_str());
ircdproto->SendGlobops(source.owner, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str());
Log(LOG_ADMIN, u, this) << "for " << nick;
}
else if (u2 && flag[0] == '-')
{
ircdproto->SendSVSO(Config->OperServ, nick, flag);
source.Reply(_("Operflags \002%s\002 have been added for \002%s\002."), flag.c_str(), nick.c_str());
ircdproto->SendGlobops(source.owner, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str());
Log(LOG_ADMIN, u, this) << "for " << nick;
}
else
this->OnSyntaxError(source, "");
+7 -7
View File
@@ -100,9 +100,7 @@ class ExpireTimer : public Timer
if (!e->expires || e->expires > Anope::CurTime)
continue;
BotInfo *bi = findbot(Config->OperServ);
if (Config->WallExceptionExpire && bi)
ircdproto->SendGlobops(bi, "Session exception for %s has expired.", e->mask.c_str());
Log(findbot(Config->OperServ), "expire/exception") << "Session exception for " << e->mask << "has expired.";
session_service->DelException(e);
delete e;
}
@@ -646,8 +644,6 @@ class OSSession : public Module
u->SendMessage(bi, "%s", Config->SessionLimitDetailsLoc.c_str());
}
u->Kill(Config->OperServ, "Session limit exceeded");
++session->hits;
if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill && akills)
{
@@ -655,8 +651,12 @@ class OSSession : public Module
XLine *x = new XLine(akillmask, Config->OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Session limit exceeded", XLineManager::GenerateUID());
akills->AddXLine(x);
akills->Send(NULL, x);
if (bi)
ircdproto->SendGlobops(bi, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask.c_str());
Log(bi, "akill/session") << "Added a temporary AKILL for \2" << akillmask << "\2 due to excessive connections";
}
else
{
u->Kill(Config->OperServ, "Session limit exceeded");
u = NULL; /* No guarentee u still exists */
}
}
}
-2
View File
@@ -84,14 +84,12 @@ class CommandOSSet : public Command
u->SuperAdmin = true;
source.Reply(_("You are now a SuperAdmin"));
Log(LOG_ADMIN, u, this) << "SUPERADMIN ON";
ircdproto->SendGlobops(source.owner, _("%s is now a Super-Admin"), u->nick.c_str());
}
else if (setting.equals_ci("OFF"))
{
u->SuperAdmin = false;
source.Reply(_("You are no longer a SuperAdmin"));
Log(LOG_ADMIN, u, this) << "SUPERADMIN OFF";
ircdproto->SendGlobops(source.owner, _("%s is no longer a Super-Admin"), u->nick.c_str());
}
else
source.Reply(_("Setting for SuperAdmin must be \002on\002 or \002off\002 (must be enabled in services.conf)"));
+1 -1
View File
@@ -57,7 +57,7 @@ class CommandOSSVSNick : public Command
else
{
source.Reply(_("The nick \002%s\002 is now being changed to \002%s\002."), nick.c_str(), newnick.c_str());
ircdproto->SendGlobops(source.owner, "%s used SVSNICK to change %s to %s", u->nick.c_str(), nick.c_str(), newnick.c_str());
Log(LOG_ADMIN, u, this) << "to change " << nick << " to " << newnick;
ircdproto->SendForceNickChange(u2, newnick, Anope::CurTime);
}
return;
+7 -15
View File
@@ -29,8 +29,7 @@ class SGLineManager : public XLineManager
void OnExpire(XLine *x)
{
if (Config->WallAkillExpire)
ircdproto->SendGlobops(OperServ, "AKILL on %s has expired", x->Mask.c_str());
Log(OperServ, "expire/akill") << "AKILL on \2" << x->Mask << "\2 has expired";
}
void Send(User *u, XLine *x)
@@ -86,8 +85,7 @@ class SQLineManager : public XLineManager
void OnExpire(XLine *x)
{
if (Config->WallSQLineExpire)
ircdproto->SendGlobops(OperServ, "SQLINE on \2%s\2 has expired", x->Mask.c_str());
Log(OperServ, "expire/sqline") << "SQLINE on \2" << x->Mask << "\2 has expired";
}
void Send(User *u, XLine *x)
@@ -127,8 +125,7 @@ class SNLineManager : public XLineManager
void OnExpire(XLine *x)
{
if (Config->WallSNLineExpire)
ircdproto->SendGlobops(OperServ, "SNLINE on \2%s\2 has expired", x->Mask.c_str());
Log(OperServ, "expire/snline") << "SNLINE on \2" << x->Mask << "\2 has expired";
}
void Send(User *u, XLine *x)
@@ -206,8 +203,7 @@ class OperServCore : public Module
if (Config->OSOpersOnly && !u->HasMode(UMODE_OPER) && bi->nick == Config->OperServ)
{
u->SendMessage(bi, ACCESS_DENIED);
if (Config->WallBadOS)
ircdproto->SendGlobops(OperServ, "Denied access to %s from %s!%s@%s (non-oper)", Config->OperServ.c_str(), u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str());
Log(OperServ, "bados") << "Denied access to " << Config->OperServ << " from " << u->GetMask() << " (non-oper)";
return EVENT_STOP;
}
@@ -217,23 +213,19 @@ class OperServCore : public Module
void OnServerQuit(Server *server)
{
if (server->HasFlag(SERVER_JUPED))
ircdproto->SendGlobops(OperServ, "Received SQUIT for juped server %s", server->GetName().c_str());
Log(server, "squit", OperServ) << "Received SQUIT for juped server " << server->GetName();
}
void OnUserModeSet(User *u, UserModeName Name)
{
if (Name == UMODE_OPER)
{
if (Config->WallOper)
ircdproto->SendGlobops(OperServ, "\2%s\2 is now an IRC operator.", u->nick.c_str());
Log(OperServ) << u->nick << " is now an IRC operator";
}
Log(u, "oper", OperServ) << "is now an IRC operator.";
}
void OnUserModeUnset(User *u, UserModeName Name)
{
if (Name == UMODE_OPER)
Log(OperServ) << u->nick << " is no longer an IRC operator";
Log(u, "oper", OperServ) << "is no longer an IRC operator";
}
void OnUserConnect(dynamic_reference<User> &u, bool &exempt)