summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.c1
-rw-r--r--src/core/bs_act.c2
-rw-r--r--src/core/bs_say.c2
-rw-r--r--src/core/os_set.c6
-rw-r--r--src/init.c6
-rw-r--r--src/log.c2
-rw-r--r--src/main.c2
-rw-r--r--src/servers.c2
8 files changed, 14 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c
index 86a70fe7d..1cdb0ef92 100644
--- a/src/config.c
+++ b/src/config.c
@@ -861,6 +861,7 @@ int ServerConfig::Read(bool bail)
{"options", "restrictopernicks", "no", new ValueContainerBool(&RestrictOperNicks), DT_BOOLEAN, NoValidation},
{"options", "newscount", "3", new ValueContainerUInt(&NewsCount), DT_UINTEGER, NoValidation},
{"options", "ulineservers", "", new ValueContainerChar(&UlineServers), DT_CHARPTR, NoValidation},
+ {"options", "enablelogchannel", "no", new ValueContainerBool(&LogChan), DT_BOOLEAN, NoValidation},
{"nickserv", "nick", "NickServ", new ValueContainerChar(&s_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "description", "Nickname Registration Service", new ValueContainerChar(&desc_NickServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty},
{"nickserv", "database", "nick.db", new ValueContainerChar(&NickDBName), DT_CHARPTR, ValidateNotEmpty},
diff --git a/src/core/bs_act.c b/src/core/bs_act.c
index 13ef27a23..c8616170a 100644
--- a/src/core/bs_act.c
+++ b/src/core/bs_act.c
@@ -50,7 +50,7 @@ class CommandBSAct : public Command
ircdproto->SendAction(ci->bi, ci->name, "%s", params[1].c_str());
ci->bi->lastmsg = time(NULL);
- if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
+ if (LogBot && LogChannel && LogChan && !debug && findchan(LogChannel))
ircdproto->SendPrivmsg(ci->bi, LogChannel, "ACT %s %s %s", u->nick, ci->name, params[1].c_str());
return MOD_CONT;
}
diff --git a/src/core/bs_say.c b/src/core/bs_say.c
index 577891cd5..dbca41518 100644
--- a/src/core/bs_say.c
+++ b/src/core/bs_say.c
@@ -57,7 +57,7 @@ class CommandBSSay : public Command
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text);
ci->bi->lastmsg = time(NULL);
- if (LogBot && LogChannel && logchan && !debug && findchan(LogChannel))
+ if (LogBot && LogChannel && LogChan && !debug && findchan(LogChannel))
ircdproto->SendPrivmsg(ci->bi, LogChannel, "SAY %s %s %s", u->nick, ci->name, text);
return MOD_CONT;
}
diff --git a/src/core/os_set.c b/src/core/os_set.c
index c74c275c9..a48ea96f9 100644
--- a/src/core/os_set.c
+++ b/src/core/os_set.c
@@ -26,7 +26,7 @@ class CommandOSSet : public Command
notice_lang(s_OperServ, u, index, "IGNORE");
index = readonly ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
notice_lang(s_OperServ, u, index, "READONLY");
- index = logchan ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
+ index = LogChan ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
notice_lang(s_OperServ, u, index, "LOGCHAN");
index = debug ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
notice_lang(s_OperServ, u, index, "DEBUG");
@@ -116,7 +116,7 @@ class CommandOSSet : public Command
c = findchan(LogChannel);
ircdproto->SendJoin(findbot(s_GlobalNoticer), LogChannel, c ? c->creation_time : time(NULL));
}
- logchan = 1;
+ LogChan = true;
alog("Now sending log messages to %s", LogChannel);
notice_lang(s_OperServ, u, OPER_SET_LOGCHAN_ON, LogChannel);
}
@@ -125,7 +125,7 @@ class CommandOSSet : public Command
alog("No longer sending log messages to a channel");
if (ircd->join2msg)
ircdproto->SendPart(findbot(s_GlobalNoticer), LogChannel, NULL);
- logchan = 0;
+ LogChan = false;
notice_lang(s_OperServ, u, OPER_SET_LOGCHAN_OFF);
}
else
diff --git a/src/init.c b/src/init.c
index 4cd654088..6373f79c7 100644
--- a/src/init.c
+++ b/src/init.c
@@ -245,7 +245,7 @@ static int parse_options(int ac, char **av)
"-logchan: LogChannel must be defined in services.conf\n");
} else { /* LogChannel */
- logchan = 1;
+ LogChan = true;
}
} else if (strcmp(s, "forceload") == 0) {
forceload = 1;
@@ -377,6 +377,10 @@ int init_primary(int ac, char **av)
return -1;
}
+ /* Disable the log channel if its defined in the conf, but not enabled */
+ if (!LogChannel && LogChan)
+ LogChan = false;
+
/* Add IRCD Protocol Module; exit if there are errors */
if (protocol_module_init()) {
return -1;
diff --git a/src/log.c b/src/log.c
index 8b5f935bf..5f739bd2c 100644
--- a/src/log.c
+++ b/src/log.c
@@ -176,7 +176,7 @@ void alog(const char *fmt, ...)
if (nofork) {
fprintf(stderr, "%s %s\n", buf, str);
}
- if (LogChannel && logchan && !debug && findchan(LogChannel)) {
+ if (LogChannel && LogChan && !debug && findchan(LogChannel)) {
ircdproto->SendPrivmsg(findbot(s_GlobalNoticer), LogChannel, "%s", str);
}
errno = errno_save;
diff --git a/src/main.c b/src/main.c
index d8fbe5627..4d9bfb1c1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,7 +48,7 @@ std::string orig_cwd; /* Original current working directory */
const char *log_filename = LOG_FILENAME; /* -log filename */
int debug = 0; /* -debug */
int readonly = 0; /* -readonly */
-int logchan = 0; /* -logchan */
+bool LogChan = false; /* -logchan */
int nofork = 0; /* -nofork */
int forceload = 0; /* -forceload */
int nothird = 0; /* -nothrid */
diff --git a/src/servers.c b/src/servers.c
index 0aa9f6f04..fa44740cc 100644
--- a/src/servers.c
+++ b/src/servers.c
@@ -166,7 +166,7 @@ Server *new_server(Server * server_uplink, const char *name, const char *desc,
introduce_user(NULL);
/* And hybrid needs Global joined in the logchan */
- if (logchan && ircd->join2msg) {
+ if (LogChan && ircd->join2msg) {
/* XXX might desync */
ircdproto->SendJoin(findbot(s_GlobalNoticer), LogChannel, time(NULL));
}