summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-02 03:08:29 -0400
committerAdam <Adam@anope.org>2010-10-02 03:08:29 -0400
commit0a8bb8808549e0f93a690fa887f46af03768c9db (patch)
tree5d082157c884fa2eaf0f3e072a17ae40f33e6f70
parenta62d824cb4266cdfbfbc81e142b22f1a2e7ed7be (diff)
Made OperServ and Global optional
-rw-r--r--data/example.conf38
-rw-r--r--docs/Changes.conf1
-rw-r--r--modules/core/os_global.cpp4
-rw-r--r--modules/extra/m_dnsbl.cpp2
-rw-r--r--modules/protocol/inspircd12.cpp12
-rw-r--r--modules/protocol/inspircd20.cpp12
-rw-r--r--src/config.cpp52
-rw-r--r--src/logger.cpp13
-rw-r--r--src/modulemanager.cpp2
-rw-r--r--src/operserv.cpp28
-rw-r--r--src/servers.cpp2
11 files changed, 106 insertions, 60 deletions
diff --git a/data/example.conf b/data/example.conf
index 22614de06..bbc6b5816 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -1317,10 +1317,10 @@ hostserv
}
/*
- * [REQUIRED] OperServ Config
+ * [RECOMMENDED] OperServ Config
*
* This section is used to set up the Operator Service pseudo-client. Unless specified otherwise,
- * all directives are required.
+ * all directives are required if you wish to use OperServ.
*/
operserv
{
@@ -1336,17 +1336,6 @@ operserv
description = "Operator Service"
/*
- * The nickname of the Global client.
- */
- globalnick = "Global"
-
- /*
- * The description of the Global client, which will be used as the GECOS (real
- * name) of the client.
- */
- globaldescription = "Global Noticer"
-
- /*
* The core modules to load for OperServ. This is a space separated list that corresponds
* to the base names of the modules for OperServ. This directive is optional, but highly recommended.
*/
@@ -1502,6 +1491,29 @@ operserv
}
/*
+ * [RECOMMENDED] Global Config
+ *
+ * This section is used to set up the Global pseudo-client. Unless specified otherwise,
+ * all directives are required if you wish to use Global.
+ *
+ * Globals two main functions are for sending globals and for logging miscellaneous data to
+ * the log channel(s). If disabled, many logs will NOT be sent to the log channel(s).
+ */
+global
+{
+ /*
+ * The nickname of the Global client.
+ */
+ globalnick = "Global"
+
+ /*
+ * The description of the Global client, which will be used as the GECOS (real
+ * name) of the client.
+ */
+ globaldescription = "Global Noticer"
+}
+
+/*
* [OPTIONAL] DefCon Config
*
* This section is used to set up the DefCon system of OperServ. The block is optional and can be
diff --git a/docs/Changes.conf b/docs/Changes.conf
index 7be05ef02..b0c120965 100644
--- a/docs/Changes.conf
+++ b/docs/Changes.conf
@@ -22,6 +22,7 @@ operserv:sglineexpiry changed to operserv:snlineexpiry
operserv:killonsgline changed to operserv:killonsnline
operserv:notifications ossgline changed ossnline
memoserv was made optional
+moved operserv:global configuration into its own global block
** DELETED CONFIGURATION DIRECTIVES **
serverinfo:helpchannel removed because it has been readded in m_helpchan
diff --git a/modules/core/os_global.cpp b/modules/core/os_global.cpp
index 961a70ab4..a63e211cd 100644
--- a/modules/core/os_global.cpp
+++ b/modules/core/os_global.cpp
@@ -57,6 +57,10 @@ class OSGlobal : public Module
this->SetAuthor("Anope");
this->SetType(CORE);
+ if (Config->s_GlobalNoticer.empty())
+ throw ModuleException("Global is disabled");
+
+ // Maybe we should put this ON Global?
this->AddCommand(OperServ, &commandosglobal);
}
};
diff --git a/modules/extra/m_dnsbl.cpp b/modules/extra/m_dnsbl.cpp
index 439798ce5..f043cde1e 100644
--- a/modules/extra/m_dnsbl.cpp
+++ b/modules/extra/m_dnsbl.cpp
@@ -66,7 +66,7 @@ class DNSBLResolver : public DNSRequest
else
{
Log(OperServ) << "DNSBL: " << user->GetMask() << " appears in " << this->blacklist.name;
- XLine xline(Anope::string("*@") + user->host, OperServ->nick, Anope::CurTime + this->blacklist.bantime, reason);
+ XLine xline(Anope::string("*@") + user->host, OperServ ? OperServ->nick : "OperServ", Anope::CurTime + this->blacklist.bantime, reason);
ircdproto->SendAkill(&xline);
}
}
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index dc5e0f613..dea238897 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -65,7 +65,7 @@ void inspircd_cmd_chghost(const Anope::string &nick, const Anope::string &vhost)
return;
}
- send_cmd(OperServ->GetUID(), "CHGHOST %s %s", nick.c_str(), vhost.c_str());
+ send_cmd(HostServ ? HostServ->GetUID() : TS6SID, "CHGHOST %s %s", nick.c_str(), vhost.c_str());
}
int anope_event_idle(const Anope::string &source, int ac, const char **av)
@@ -88,7 +88,7 @@ class InspIRCdProto : public IRCDProto
{
void SendAkillDel(const XLine *x)
{
- send_cmd(OperServ->GetUID(), "GLINE %s", x->Mask.c_str());
+ send_cmd(OperServ ? OperServ->GetUID() : TS6SID, "GLINE %s", x->Mask.c_str());
}
void SendTopic(BotInfo *whosets, Channel *c)
@@ -113,7 +113,7 @@ class InspIRCdProto : public IRCDProto
time_t timeleft = x->Expires - Anope::CurTime;
if (timeleft > 172800 || !x->Expires)
timeleft = 172800;
- send_cmd(OperServ->GetUID(), "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
+ send_cmd(OperServ ? OperServ->GetUID() : TS6SID, "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
@@ -220,19 +220,19 @@ class InspIRCdProto : public IRCDProto
if (!has_chgidentmod)
ircdproto->SendGlobops(OperServ, "CHGIDENT not loaded!");
else
- send_cmd(OperServ->GetUID(), "CHGIDENT %s %s", nick.c_str(), vIdent.c_str());
+ send_cmd(HostServ ? HostServ->GetUID() : TS6SID, "CHGIDENT %s %s", nick.c_str(), vIdent.c_str());
}
/* SVSHOLD - set */
void SendSVSHold(const Anope::string &nick)
{
- send_cmd(OperServ->GetUID(), "SVSHOLD %s %u :Being held for registered user", nick.c_str(), static_cast<unsigned>(Config->NSReleaseTimeout));
+ send_cmd(NickServ->GetUID(), "SVSHOLD %s %u :Being held for registered user", nick.c_str(), static_cast<unsigned>(Config->NSReleaseTimeout));
}
/* SVSHOLD - release */
void SendSVSHoldDel(const Anope::string &nick)
{
- send_cmd(OperServ->GetUID(), "SVSHOLD %s", nick.c_str());
+ send_cmd(NickServ->GetUID(), "SVSHOLD %s", nick.c_str());
}
/* UNSZLINE */
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 5740c43b8..8e610dbc5 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -63,7 +63,7 @@ void inspircd_cmd_chghost(const Anope::string &nick, const Anope::string &vhost)
return;
}
- send_cmd(OperServ->GetUID(), "CHGHOST %s %s", nick.c_str(), vhost.c_str());
+ send_cmd(HostServ ? HostServ->GetUID() : TS6SID, "CHGHOST %s %s", nick.c_str(), vhost.c_str());
}
int anope_event_idle(const Anope::string &source, int ac, const char **av)
@@ -86,7 +86,7 @@ class InspIRCdProto : public IRCDProto
{
void SendAkillDel(const XLine *x)
{
- send_cmd(OperServ->GetUID(), "GLINE %s", x->Mask.c_str());
+ send_cmd(OperServ ? OperServ->GetUID() : TS6SID, "GLINE %s", x->Mask.c_str());
}
void SendTopic(BotInfo *whosets, Channel *c)
@@ -111,7 +111,7 @@ class InspIRCdProto : public IRCDProto
time_t timeleft = x->Expires - Anope::CurTime;
if (timeleft > 172800 || !x->Expires)
timeleft = 172800;
- send_cmd(OperServ->GetUID(), "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
+ send_cmd(OperServ ? OperServ->GetUID() : TS6SID, "ADDLINE G %s@%s %s %ld %ld :%s", x->GetUser().c_str(), x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
}
void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
@@ -221,19 +221,19 @@ class InspIRCdProto : public IRCDProto
if (!has_chgidentmod)
ircdproto->SendGlobops(OperServ, "CHGIDENT not loaded!");
else
- send_cmd(OperServ->GetUID(), "CHGIDENT %s %s", nick.c_str(), vIdent.c_str());
+ send_cmd(HostServ ? HostServ->GetUID() : TS6SID, "CHGIDENT %s %s", nick.c_str(), vIdent.c_str());
}
/* SVSHOLD - set */
void SendSVSHold(const Anope::string &nick)
{
- send_cmd(OperServ->GetUID(), "SVSHOLD %s %u :Being held for registered user", nick.c_str(), static_cast<unsigned>(Config->NSReleaseTimeout));
+ send_cmd(NickServ->GetUID(), "SVSHOLD %s %u :Being held for registered user", nick.c_str(), static_cast<unsigned>(Config->NSReleaseTimeout));
}
/* SVSHOLD - release */
void SendSVSHoldDel(const Anope::string &nick)
{
- send_cmd(OperServ->GetUID(), "SVSHOLD %s", nick.c_str());
+ send_cmd(NickServ->GetUID(), "SVSHOLD %s", nick.c_str());
}
/* UNSZLINE */
diff --git a/src/config.cpp b/src/config.cpp
index a3374c0be..849d943c2 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -583,11 +583,8 @@ bool ValidateHostServ(ServerConfig *config, const Anope::string &tag, const Anop
{
if (!config->s_HostServ.empty())
{
- if (value.equals_ci("description"))
- {
- if (data.GetValue().empty())
- throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when HostServ is enabled!");
- }
+ if (value.equals_ci("description") && data.GetValue().empty())
+ throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when HostServ is enabled!");
}
return true;
}
@@ -605,6 +602,27 @@ bool ValidateLimitSessions(ServerConfig *config, const Anope::string &tag, const
return true;
}
+bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data)
+{
+ if (!config->s_OperServ.empty())
+ {
+ if ((value.equals_ci("description") || value.equals_ci("globalnick") || value.equals_ci("globaldescription")) && data.GetValue().empty())
+ throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when OperServ is enabled!");
+ else if (value.equals_ci("autokillexpiry") || value.equals_ci("chankillexpiry") || value.equals_ci("snlineexpiry") || value.equals_ci("szlineexpiry") || value.equals_ci("sqlineexpiry"))
+ return ValidateNotZero(config, tag, value, data);
+ else if (value.equals_ci("maxsessionlimit") || value.equals_ci("exceptionexpiry"))
+ return ValidateLimitSessions(config, tag, value, data);
+ }
+ return true;
+}
+
+bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data)
+{
+ if (!config->s_GlobalNoticer.empty() && config->desc_GlobalNoticer.empty())
+ throw ConfigException("The value for <" + tag + ":" + value + "> cannot be empty when Global is enabled!");
+ return true;
+}
+
bool ValidateDefCon(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data)
{
if (value.equals_ci("defaultlevel"))
@@ -951,7 +969,7 @@ void ServerConfig::Read()
{
errstr.clear();
// These tags MUST occur and must ONLY occur once in the config file
- static const Anope::string Once[] = {"serverinfo", "networkinfo", "options", "nickserv", "chanserv", "memoserv", "operserv", ""};
+ static const Anope::string Once[] = {"serverinfo", "networkinfo", "options", "nickserv", "chanserv", ""};
// These tags can occur ONCE or not at all
InitialConfig Values[] = {
/* The following comments are from CyberBotX to w00t as examples to use:
@@ -1122,31 +1140,31 @@ void ServerConfig::Read()
{"hostserv", "nick", "", new ValueContainerString(&this->s_HostServ), DT_STRING | DT_NORELOAD, NoValidation},
{"hostserv", "description", "vHost Service", new ValueContainerString(&this->desc_HostServ), DT_STRING | DT_NORELOAD, ValidateHostServ},
{"hostserv", "modules", "", new ValueContainerString(&HostCoreModules), DT_STRING, NoValidation},
- {"operserv", "nick", "OperServ", new ValueContainerString(&this->s_OperServ), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
- {"operserv", "description", "Operator Service", new ValueContainerString(&this->desc_OperServ), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
- {"operserv", "globalnick", "Global", new ValueContainerString(&this->s_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
- {"operserv", "globaldescription", "Global Noticer", new ValueContainerString(&this->desc_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateNotEmpty},
+ {"operserv", "nick", "", new ValueContainerString(&this->s_OperServ), DT_STRING | DT_NORELOAD, ValidateOperServ},
+ {"operserv", "description", "Operator Service", new ValueContainerString(&this->desc_OperServ), DT_STRING | DT_NORELOAD, ValidateOperServ},
{"operserv", "modules", "", new ValueContainerString(&OperCoreModules), DT_STRING, NoValidation},
{"operserv", "superadmin", "no", new ValueContainerBool(&this->SuperAdmin), DT_BOOLEAN, NoValidation},
- {"operserv", "autokillexpiry", "0", new ValueContainerTime(&this->AutokillExpiry), DT_TIME, ValidateNotZero},
- {"operserv", "chankillexpiry", "0", new ValueContainerTime(&this->ChankillExpiry), DT_TIME, ValidateNotZero},
- {"operserv", "snlineexpiry", "0", new ValueContainerTime(&this->SNLineExpiry), DT_TIME, ValidateNotZero},
- {"operserv", "sqlineexpiry", "0", new ValueContainerTime(&this->SQLineExpiry), DT_TIME, ValidateNotZero},
- {"operserv", "szlineexpiry", "0", new ValueContainerTime(&this->SZLineExpiry), DT_TIME, ValidateNotZero},
+ {"operserv", "autokillexpiry", "0", new ValueContainerTime(&this->AutokillExpiry), DT_TIME, ValidateOperServ},
+ {"operserv", "chankillexpiry", "0", new ValueContainerTime(&this->ChankillExpiry), DT_TIME, ValidateOperServ},
+ {"operserv", "snlineexpiry", "0", new ValueContainerTime(&this->SNLineExpiry), DT_TIME, ValidateOperServ},
+ {"operserv", "sqlineexpiry", "0", new ValueContainerTime(&this->SQLineExpiry), DT_TIME, ValidateOperServ},
+ {"operserv", "szlineexpiry", "0", new ValueContainerTime(&this->SZLineExpiry), DT_TIME, ValidateOperServ},
{"operserv", "akillonadd", "no", new ValueContainerBool(&this->AkillOnAdd), DT_BOOLEAN, NoValidation},
{"operserv", "killonsnline", "no", new ValueContainerBool(&this->KillonSNline), DT_BOOLEAN, NoValidation},
{"operserv", "killonsqline", "no", new ValueContainerBool(&this->KillonSQline), DT_BOOLEAN, NoValidation},
{"operserv", "notifications", "", new ValueContainerString(&OSNotifications), DT_STRING, NoValidation},
{"operserv", "limitsessions", "no", new ValueContainerBool(&this->LimitSessions), DT_BOOLEAN, NoValidation},
{"operserv", "defaultsessionlimit", "0", new ValueContainerUInt(&this->DefSessionLimit), DT_UINTEGER, NoValidation},
- {"operserv", "maxsessionlimit", "0", new ValueContainerUInt(&this->MaxSessionLimit), DT_UINTEGER, ValidateLimitSessions},
- {"operserv", "exceptionexpiry", "0", new ValueContainerTime(&this->ExceptionExpiry), DT_TIME, ValidateLimitSessions},
+ {"operserv", "maxsessionlimit", "0", new ValueContainerUInt(&this->MaxSessionLimit), DT_UINTEGER, ValidateOperServ},
+ {"operserv", "exceptionexpiry", "0", new ValueContainerTime(&this->ExceptionExpiry), DT_TIME, ValidateOperServ},
{"operserv", "sessionlimitexceeded", "", new ValueContainerString(&this->SessionLimitExceeded), DT_STRING, NoValidation},
{"operserv", "sessionlimitdetailsloc", "", new ValueContainerString(&this->SessionLimitDetailsLoc), DT_STRING, NoValidation},
{"operserv", "maxsessionkill", "0", new ValueContainerInt(&this->MaxSessionKill), DT_INTEGER, NoValidation},
{"operserv", "sessionautokillexpiry", "0", new ValueContainerTime(&this->SessionAutoKillExpiry), DT_TIME, NoValidation},
{"operserv", "addakiller", "no", new ValueContainerBool(&this->AddAkiller), DT_BOOLEAN, NoValidation},
{"operserv", "opersonly", "no", new ValueContainerBool(&this->OSOpersOnly), DT_BOOLEAN, NoValidation},
+ {"global", "globalnick", "", new ValueContainerString(&this->s_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateGlobal},
+ {"global", "globaldescription", "Global Noticer", new ValueContainerString(&this->desc_GlobalNoticer), DT_STRING | DT_NORELOAD, ValidateGlobal},
{"defcon", "defaultlevel", "0", new ValueContainerInt(&DefConLevel), DT_INTEGER, ValidateDefCon},
{"defcon", "level4", "", new ValueContainerString(&DefCon4), DT_STRING, ValidateDefCon},
{"defcon", "level3", "", new ValueContainerString(&DefCon3), DT_STRING, ValidateDefCon},
diff --git a/src/logger.cpp b/src/logger.cpp
index 61e8915b8..d5982c3c7 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -104,6 +104,8 @@ Anope::string LogFile::GetName() const
Log::Log(LogType type, const Anope::string &category, BotInfo *b) : bi(b), Type(type), Category(category)
{
+ if (!b)
+ b = Global;
if (b)
this->Sources.push_back(b->nick);
}
@@ -118,7 +120,8 @@ Log::Log(LogType type, User *u, Command *c, ChannelInfo *ci) : Type(type)
this->bi = c->service ? c->service : Global;
this->Category = (c->service ? c->service->nick + "/" : "") + c->name;
- this->Sources.push_back(this->bi->nick);
+ if (this->bi)
+ this->Sources.push_back(this->bi->nick);
this->Sources.push_back(u->nick);
this->Sources.push_back(c->name);
if (ci)
@@ -172,6 +175,8 @@ Log::Log(Server *s, const Anope::string &category) : bi(OperServ), Type(LOG_SERV
if (!s)
throw CoreException("Invalid pointer passed to Log::Log");
+ if (!this->bi)
+ this->bi = Global;
if (this->bi)
this->Sources.push_back(this->bi->nick);
this->Sources.push_back(s->GetName());
@@ -182,9 +187,9 @@ Log::Log(Server *s, const Anope::string &category) : bi(OperServ), Type(LOG_SERV
Log::Log(BotInfo *b, const Anope::string &category) : bi(b), Type(LOG_USER), Category(category)
{
if (!b)
- throw CoreException("Invalid opinter passed to Log::Log");
-
- this->Sources.push_back(bi->nick);
+ b = Global;
+ if (this->bi)
+ this->Sources.push_back(bi->nick);
}
Log::~Log()
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index d2dd6cd53..e637d32c6 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -260,7 +260,7 @@ void ModuleManager::DeleteModule(Module *m)
const char *err = ano_moderr();
if (!destroy_func && err && *err)
{
- Log() << "No destroy function found, chancing delete...";
+ Log() << "No destroy function found for " << m->name << ", chancing delete...";
delete m; /* we just have to chance they haven't overwrote the delete operator then... */
}
else
diff --git a/src/operserv.cpp b/src/operserv.cpp
index c99b78238..ef561a03d 100644
--- a/src/operserv.cpp
+++ b/src/operserv.cpp
@@ -23,17 +23,20 @@ Flags<ChannelModeName, CMODE_END * 2> DefConModesOff;
/* Map of Modesa and Params for DefCon */
std::map<ChannelModeName, Anope::string> DefConModesOnParams;
-XLineManager *SGLine, *SZLine, *SQLine, *SNLine;
+XLineManager *SGLine = NULL, *SZLine = NULL, *SQLine = NULL, *SNLine = NULL;
void os_init()
{
- ModuleManager::LoadModuleList(Config->OperServCoreModules);
+ if (!Config->s_OperServ.empty())
+ {
+ ModuleManager::LoadModuleList(Config->OperServCoreModules);
- /* Yes, these are in this order for a reason. Most violent->least violent. */
- XLineManager::RegisterXLineManager(SGLine = new SGLineManager());
- XLineManager::RegisterXLineManager(SZLine = new SZLineManager());
- XLineManager::RegisterXLineManager(SQLine = new SQLineManager());
- XLineManager::RegisterXLineManager(SNLine = new SNLineManager());
+ /* Yes, these are in this order for a reason. Most violent->least violent. */
+ XLineManager::RegisterXLineManager(SGLine = new SGLineManager());
+ XLineManager::RegisterXLineManager(SZLine = new SZLineManager());
+ XLineManager::RegisterXLineManager(SQLine = new SQLineManager());
+ XLineManager::RegisterXLineManager(SNLine = new SNLineManager());
+ }
}
bool SetDefConParam(ChannelModeName Name, const Anope::string &buf)
@@ -105,6 +108,9 @@ void DelDefCon(int level, DefconLevel Level)
void server_global(const Server *s, const Anope::string &message)
{
+ if (Config->s_GlobalNoticer.empty())
+ return;
+
/* Do not send the notice to ourselves our juped servers */
if (s != Me && !s->HasFlag(SERVER_JUPED))
notice_server(Config->s_GlobalNoticer, s, "%s", message.c_str());
@@ -490,7 +496,7 @@ XLine *SGLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
if (u && Config->AddAkiller)
realreason = "[" + u->nick + "]" + reason;
- XLine *x = new XLine(mask, u ? u->nick : OperServ->nick, expires, realreason);
+ XLine *x = new XLine(mask, u ? u->nick : (OperServ ? OperServ->nick : "OperServ"), expires, realreason);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnAddAkill, OnAddAkill(u, x));
@@ -549,7 +555,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
return NULL;
}
- XLine *x = new XLine(mask, u ? u->nick : OperServ->nick, expires, reason);
+ XLine *x = new XLine(mask, u ? u->nick : (OperServ ? OperServ->nick : "OperServ"), expires, reason);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SNLINE));
@@ -629,7 +635,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
return NULL;
}
- XLine *x = new XLine(mask, u ? u->nick : OperServ->nick, expires, reason);
+ XLine *x = new XLine(mask, u ? u->nick : (OperServ ? OperServ->nick : "OperServ"), expires, reason);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SQLINE));
@@ -747,7 +753,7 @@ XLine *SZLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
return NULL;
}
- XLine *x = new XLine(mask, u ? u->nick : OperServ->nick, expires, reason);
+ XLine *x = new XLine(mask, u ? u->nick : (OperServ ? OperServ->nick : "OperServ"), expires, reason);
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnAddXLine, OnAddXLine(u, x, X_SZLINE));
diff --git a/src/servers.cpp b/src/servers.cpp
index d8752d90b..d7517405a 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -342,7 +342,7 @@ void do_server(const Anope::string &source, const Anope::string &servername, uns
Server *newserver = new Server(s, servername, hops, descript, numeric);
/* Announce services being online. */
- if (Config->GlobalOnCycle && !Config->GlobalOnCycleUP.empty())
+ if (Config->GlobalOnCycle && !Config->GlobalOnCycleUP.empty() && !Config->s_GlobalNoticer.empty())
notice_server(Config->s_GlobalNoticer, newserver, "%s", Config->GlobalOnCycleUP.c_str());
/* Let modules know about the connection */