summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-29 03:03:18 -0400
committerJune McEnroe <june@causal.agency>2019-10-29 03:03:18 -0400
commite9e351ba8b8bd35d63ec2629aec2c77d0685e7cd (patch)
tree32954122b559a57f9d4455951fc4c1b4530fde62
parentUse ETCDIR variable for install target (diff)
downloadpounce-e9e351ba8b8bd35d63ec2629aec2c77d0685e7cd.tar.gz
pounce-e9e351ba8b8bd35d63ec2629aec2c77d0685e7cd.zip
Relay optional 5th RPL_MYINFO parameter
Diffstat (limited to '')
-rw-r--r--state.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/state.c b/state.c
index 85740ed..b1f84ad 100644
--- a/state.c
+++ b/state.c
@@ -123,7 +123,7 @@ static struct {
 	char *welcome;
 	char *yourHost;
 	char *created;
-	char *myInfo[4];
+	char *myInfo[5];
 } intro;
 
 const char *stateEcho(void) {
@@ -176,6 +176,7 @@ static void handleReplyMyInfo(struct Message *msg) {
 	set(&intro.myInfo[1], msg->params[2]);
 	set(&intro.myInfo[2], msg->params[3]);
 	set(&intro.myInfo[3], msg->params[4]);
+	if (msg->params[5]) set(&intro.myInfo[4], msg->params[5]);
 }
 
 static struct {
@@ -343,12 +344,13 @@ void stateSync(struct Client *client) {
 		":%s 001 %s :%s\r\n"
 		":%s 002 %s :%s\r\n"
 		":%s 003 %s :%s\r\n"
-		":%s 004 %s %s %s %s %s\r\n",
+		":%s 004 %s %s %s %s %s%s%s\r\n",
 		intro.origin, self.nick, intro.welcome,
 		intro.origin, self.nick, intro.yourHost,
 		intro.origin, self.nick, intro.created,
 		intro.origin, self.nick,
-		intro.myInfo[0], intro.myInfo[1], intro.myInfo[2], intro.myInfo[3]
+		intro.myInfo[0], intro.myInfo[1], intro.myInfo[2], intro.myInfo[3],
+		(intro.myInfo[4] ? " " : ""), (intro.myInfo[4] ? intro.myInfo[4] : "")
 	);
 
 	size_t i;