summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-02-12 16:17:17 -0500
committerAdam <Adam@anope.org>2011-02-12 16:17:17 -0500
commit1372dc19537ce270f1f02979101f9b8678b5ff28 (patch)
treed56f688ec113293a2e40c78d615558f1163dad7b /src
parent9ef7352e69bc092bba77a085dfa0f91a5793e038 (diff)
Removed the Wallop config options and replaced them with the new log system
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp31
-rw-r--r--src/logger.cpp9
-rw-r--r--src/misc.cpp23
3 files changed, 20 insertions, 43 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 17659bc02..6bf0a522f 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -167,9 +167,8 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla
}
}
- this->WallOper = this->WallBadOS = this->WallOSGlobal = this->WallOSMode = this->WallOSKick = this->WallOSAkill = this->WallOSSNLine = this->WallOSSQLine =
- this->WallOSSZLine = this->WallOSNoOp = this->WallOSJupe = this->WallAkillExpire = this->WallSNLineExpire = this->WallSQLineExpire = this->WallSZLineExpire = this->WallExceptionExpire =
- this->WallGetpass = this->WallSetpass = this->WallForbid = this->WallDrop = false;
+ this->WallOper = this->WallBadOS = this->WallAkillExpire = this->WallSNLineExpire = this->WallSQLineExpire =
+ this->WallSZLineExpire = this->WallExceptionExpire = false;
if (!OSNotifications.empty())
{
spacesepstream notifications(OSNotifications);
@@ -180,24 +179,6 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla
this->WallOper = true;
else if (notice.equals_ci("bados"))
this->WallBadOS = true;
- else if (notice.equals_ci("osglobal"))
- this->WallOSGlobal = true;
- else if (notice.equals_ci("osmode"))
- this->WallOSMode = true;
- else if (notice.equals_ci("oskick"))
- this->WallOSKick = true;
- else if (notice.equals_ci("osakill"))
- this->WallOSAkill = true;
- else if (notice.equals_ci("ossnline"))
- this->WallOSSNLine = true;
- else if (notice.equals_ci("ossqline"))
- this->WallOSSQLine = true;
- else if (notice.equals_ci("osszline"))
- this->WallOSSZLine = true;
- else if (notice.equals_ci("osnoop"))
- this->WallOSNoOp = true;
- else if (notice.equals_ci("osjupe"))
- this->WallOSJupe = true;
else if (notice.equals_ci("akillexpire"))
this->WallAkillExpire = true;
else if (notice.equals_ci("snlineexpire"))
@@ -208,14 +189,6 @@ ServerConfig::ServerConfig() : errstr(""), config_data(), NSDefFlags(NickCoreFla
this->WallSZLineExpire = true;
else if (notice.equals_ci("exceptionexpire"))
this->WallExceptionExpire = true;
- else if (notice.equals_ci("getpass"))
- this->WallGetpass = true;
- else if (notice.equals_ci("setpass"))
- this->WallSetpass = true;
- else if (notice.equals_ci("forbid"))
- this->WallForbid = true;
- else if (notice.equals_ci("drop"))
- this->WallDrop = true;
}
}
diff --git a/src/logger.cpp b/src/logger.cpp
index 1328e4f57..42bac03cb 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -265,7 +265,9 @@ std::list<Anope::string> &LogInfo::GetList(LogType type)
switch (type)
{
case LOG_ADMIN:
+ return this->Admin;
case LOG_OVERRIDE:
+ return this->Override;
case LOG_COMMAND:
return this->Commands;
case LOG_SERVER:
@@ -348,6 +350,13 @@ void LogInfo::ProcessMessage(const Log *l)
ircdproto->SendPrivmsg(l->bi, c->name, "%s", l->buf.str().c_str());
}
}
+ else if (target == "globops")
+ {
+ if (UplinkSock && l->bi && l->Type <= LOG_NORMAL && Me && Me->IsSynced())
+ {
+ ircdproto->SendGlobops(l->bi, "%s", l->buf.str().c_str());
+ }
+ }
else
{
LogFile *log = NULL;
diff --git a/src/misc.cpp b/src/misc.cpp
index 340207cb0..daf7fe363 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -245,39 +245,34 @@ time_t dotime(const Anope::string &s)
Anope::string duration(NickCore *nc, time_t seconds)
{
/* We first calculate everything */
- int days = seconds / 86400;
+ time_t days = seconds / 86400;
seconds -= (days * 86400);
- int hours = seconds / 3600;
+ time_t hours = seconds / 3600;
seconds -= (hours * 3600);
- int minutes = seconds / 60;
+ time_t minutes = seconds / 60;
- char buf[64];
Anope::string buffer;
if (!days && !hours && !minutes)
- {
- snprintf(buf, sizeof(buf), GetString(nc, "%d second%s").c_str(), seconds, seconds != 1 ? "s" : "");
- buffer = buf;
- }
+ buffer = stringify(seconds) + " second" + (seconds != 1 ? "s" : "");
else
{
bool need_comma = false;
if (days)
{
- snprintf(buf, sizeof(buf), GetString(nc, "%d day%s").c_str(), days, days != 1 ? "s" : "");
- buffer = buf;
+ buffer = stringify(days) + " day" + (days != 1 ? "s" : "");
need_comma = true;
}
if (hours)
{
- snprintf(buf, sizeof(buf), GetString(nc, "%d hour%s").c_str(), hours, hours != 1 ? "s" : "");
- buffer += Anope::string(need_comma ? ", " : "") + buf;
+ buffer += need_comma ? ", " : "";
+ buffer += stringify(hours) + " hour" + (hours != 1 ? "s" : "");
need_comma = true;
}
if (minutes)
{
- snprintf(buf, sizeof(buf), GetString(nc, "%d minute%s").c_str(), minutes != 1 ? "s" : "");
- buffer += Anope::string(need_comma ? ", " : "") + buf;
+ buffer += need_comma ? ", " : "";
+ buffer += stringify(minutes) + " minute" + (minutes != 1 ? "s" : "");
}
}