mirror of
https://github.com/anope/anope.git
synced 2026-07-04 03:43:13 +02:00
Removed operserv:notifications in favor of log blocks, as well as some other notifiications
This commit is contained in:
@@ -19,7 +19,6 @@ ConfigurationFile services_conf("services.conf", false); // Services configurati
|
||||
ServerConfig *Config = NULL;
|
||||
|
||||
static Anope::string UlineServers;
|
||||
static Anope::string OSNotifications;
|
||||
static Anope::string BSDefaults;
|
||||
static Anope::string CSDefaults;
|
||||
static Anope::string NSDefaults;
|
||||
@@ -138,29 +137,6 @@ ServerConfig::ServerConfig() : config_data(), NSDefFlags(NickCoreFlagStrings), C
|
||||
}
|
||||
}
|
||||
|
||||
this->WallOper = this->WallBadOS = this->WallAkillExpire = this->WallSNLineExpire = this->WallSQLineExpire =
|
||||
this->WallExceptionExpire = false;
|
||||
if (!OSNotifications.empty())
|
||||
{
|
||||
spacesepstream notifications(OSNotifications);
|
||||
Anope::string notice;
|
||||
while (notifications.GetToken(notice))
|
||||
{
|
||||
if (notice.equals_ci("oper"))
|
||||
this->WallOper = true;
|
||||
else if (notice.equals_ci("bados"))
|
||||
this->WallBadOS = true;
|
||||
else if (notice.equals_ci("akillexpire"))
|
||||
this->WallAkillExpire = true;
|
||||
else if (notice.equals_ci("snlineexpire"))
|
||||
this->WallSNLineExpire = true;
|
||||
else if (notice.equals_ci("sqlineexpire"))
|
||||
this->WallSQLineExpire = true;
|
||||
else if (notice.equals_ci("exceptionexpire"))
|
||||
this->WallExceptionExpire = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ulines */
|
||||
if (!UlineServers.empty())
|
||||
{
|
||||
@@ -1267,7 +1243,6 @@ ConfigItems::ConfigItems(ServerConfig *conf)
|
||||
{"operserv", "akillonadd", "no", new ValueContainerBool(&conf->AkillOnAdd), DT_BOOLEAN, NoValidation},
|
||||
{"operserv", "killonsnline", "no", new ValueContainerBool(&conf->KillonSNline), DT_BOOLEAN, NoValidation},
|
||||
{"operserv", "killonsqline", "no", new ValueContainerBool(&conf->KillonSQline), DT_BOOLEAN, NoValidation},
|
||||
{"operserv", "notifications", "", new ValueContainerString(&OSNotifications), DT_STRING, NoValidation},
|
||||
{"operserv", "limitsessions", "no", new ValueContainerBool(&conf->LimitSessions), DT_BOOLEAN, NoValidation},
|
||||
{"operserv", "defaultsessionlimit", "0", new ValueContainerUInt(&conf->DefSessionLimit), DT_UINTEGER, NoValidation},
|
||||
{"operserv", "maxsessionlimit", "0", new ValueContainerUInt(&conf->MaxSessionLimit), DT_UINTEGER, ValidateOperServ},
|
||||
|
||||
+15
-9
@@ -108,23 +108,25 @@ Log::Log(User *_u, Channel *ch, const Anope::string &category) : u(_u), c(NULL),
|
||||
this->Sources.push_back(chan->name);
|
||||
}
|
||||
|
||||
Log::Log(User *_u, const Anope::string &category) : bi(NULL), u(_u), c(NULL), chan(NULL), ci(NULL), s(NULL), Type(LOG_USER), Category(category)
|
||||
Log::Log(User *_u, const Anope::string &category, BotInfo *_bi) : bi(_bi), u(_u), c(NULL), chan(NULL), ci(NULL), s(NULL), Type(LOG_USER), Category(category)
|
||||
{
|
||||
if (!u)
|
||||
throw CoreException("Invalid pointers passed to Log::Log");
|
||||
|
||||
this->bi = Config ? findbot(Config->Global) : NULL;
|
||||
if (!this->bi)
|
||||
this->bi = Config ? findbot(Config->Global) : NULL;
|
||||
if (this->bi)
|
||||
this->Sources.push_back(this->bi->nick);
|
||||
this->Sources.push_back(u->nick);
|
||||
}
|
||||
|
||||
Log::Log(Server *serv, const Anope::string &category) : bi(NULL), u(NULL), c(NULL), chan(NULL), ci(NULL), s(serv), Type(LOG_SERVER), Category(category)
|
||||
Log::Log(Server *serv, const Anope::string &category, BotInfo *_bi) : bi(_bi), u(NULL), c(NULL), chan(NULL), ci(NULL), s(serv), Type(LOG_SERVER), Category(category)
|
||||
{
|
||||
if (!s)
|
||||
throw CoreException("Invalid pointer passed to Log::Log");
|
||||
|
||||
this->bi = Config ? findbot(Config->OperServ) : NULL;
|
||||
if (!this->bi)
|
||||
this->bi = Config ? findbot(Config->OperServ) : NULL;
|
||||
if (!this->bi)
|
||||
this->bi = Config ? findbot(Config->Global) : NULL;
|
||||
if (this->bi)
|
||||
@@ -167,7 +169,7 @@ Anope::string Log::BuildPrefix() const
|
||||
{
|
||||
case LOG_ADMIN:
|
||||
{
|
||||
if (!this->c)
|
||||
if (!this->c || !this->u)
|
||||
break;
|
||||
buffer += "ADMIN: ";
|
||||
size_t sl = this->c->name.find('/');
|
||||
@@ -179,7 +181,7 @@ Anope::string Log::BuildPrefix() const
|
||||
}
|
||||
case LOG_OVERRIDE:
|
||||
{
|
||||
if (!this->c)
|
||||
if (!this->c || !this->u)
|
||||
break;
|
||||
buffer += "OVERRIDE: ";
|
||||
size_t sl = this->c->name.find('/');
|
||||
@@ -191,7 +193,7 @@ Anope::string Log::BuildPrefix() const
|
||||
}
|
||||
case LOG_COMMAND:
|
||||
{
|
||||
if (!this->c)
|
||||
if (!this->c || !this->u)
|
||||
break;
|
||||
buffer += "COMMAND: ";
|
||||
size_t sl = this->c->name.find('/');
|
||||
@@ -203,6 +205,8 @@ Anope::string Log::BuildPrefix() const
|
||||
}
|
||||
case LOG_CHANNEL:
|
||||
{
|
||||
if (!this->chan)
|
||||
break;
|
||||
buffer += "CHANNEL: ";
|
||||
if (this->u)
|
||||
buffer += this->u->GetMask() + " " + this->Category + " " + this->chan->name + " ";
|
||||
@@ -212,12 +216,14 @@ Anope::string Log::BuildPrefix() const
|
||||
}
|
||||
case LOG_USER:
|
||||
{
|
||||
buffer += "USERS: " + this->u->GetMask() + " ";
|
||||
if (this->u)
|
||||
buffer += "USERS: " + this->u->GetMask() + " ";
|
||||
break;
|
||||
}
|
||||
case LOG_SERVER:
|
||||
{
|
||||
buffer += "SERVER: " + this->s->GetName() + " (" + this->s->GetDescription() + ") ";
|
||||
if (this->s)
|
||||
buffer += "SERVER: " + this->s->GetName() + " (" + this->s->GetDescription() + ") ";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user