commit 2545314641e3f498d0aa6569e59689890b1f57f3
parent 8218d3b77644c6c2e9ed3df2ac71e21cbc80fd15
Author: hhvn <dev@hhvn.uk>
Date: Tue, 12 Apr 2022 12:34:21 +0100
Move (quit|part|kill) message vars to def.*
Diffstat:
2 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/commands.c b/src/commands.c
@@ -217,7 +217,7 @@ struct Command commands[] = {
{"kill", command_kill, 1, {
"usage: /kill <nick> [reason]",
"Forcefully disconnect a nick from a server.",
- "Uses misc.killmessage if no reason provided.", NULL}},
+ "Uses def.killmessage if no reason provided.", NULL}},
{"links", command_links, 1, {
"usage: /links [[server] mask]",
"Request list of linked servers from the veiwpoint",
@@ -539,7 +539,7 @@ command_query) {
COMMAND(
command_quit) {
- cleanup(str ? str : config_gets("misc.quitmessage"));
+ cleanup(str ? str : config_gets("def.quitmessage"));
exit(EXIT_SUCCESS);
}
@@ -592,7 +592,7 @@ command_part) {
}
}
- snprintf(msg, sizeof(msg), "PART %s :%s\r\n", chan, reason ? reason : config_gets("misc.partmessage"));
+ snprintf(msg, sizeof(msg), "PART %s :%s\r\n", chan, reason ? reason : config_gets("def.partmessage"));
ircprintf(server, "%s", msg);
expect_set(server, Expect_part, chan);
@@ -908,7 +908,7 @@ command_disconnect) {
} else sp = server;
if (!msg || !*msg)
- msg = config_gets("misc.quitmessage");
+ msg = config_gets("def.quitmessage");
/* Add fake quit messages to history.
* Theoretically, we could send QUIT and then wait for a
@@ -1277,7 +1277,7 @@ command_kill) {
nick = strtok_r(str, " ", &reason);
if (!reason)
- reason = config_gets("misc.killmessage");
+ reason = config_gets("def.killmessage");
ircprintf(server, "KILL %s :%s\r\n", nick, reason);
}
diff --git a/src/config.c b/src/config.c
@@ -73,6 +73,21 @@ struct Config config[] = {
.strhandle = NULL,
.description = {
"Default \"realname\", seen in /whois", NULL}},
+ {"def.quitmessage", 1, Val_string,
+ .str = "quit",
+ .strhandle = NULL,
+ .description = {
+ "Message to send on /quit", NULL}},
+ {"def.partmessage", 1, Val_string,
+ .str = "part",
+ .strhandle = NULL,
+ .description = {
+ "Message to send on /part", NULL}},
+ {"def.killmessage", 1, Val_string,
+ .str = "no reason",
+ .strhandle = NULL,
+ .description = {
+ "Message to send on /kill", NULL}},
{"def.chantypes", 1, Val_string,
.str = "#&!+",
.strhandle = NULL,
@@ -172,21 +187,6 @@ struct Config config[] = {
"from server to send PING. If ping.wait seconds",
"elapses since sending a PING, hirc will consider",
"the server disconnected.", NULL}},
- {"misc.quitmessage", 1, Val_string,
- .str = "pain is temporary",
- .strhandle = NULL,
- .description = {
- "Message to send on /quit", NULL}},
- {"misc.partmessage", 1, Val_string,
- .str = "pain is temporary",
- .strhandle = NULL,
- .description = {
- "Message to send on /part", NULL}},
- {"misc.killmessage", 1, Val_string,
- .str = "no reason",
- .strhandle = NULL,
- .description = {
- "Message to send on /kill", NULL}},
{"misc.bell", 1, Val_bool,
.num = 1,
.numhandle = config_redrawl,