summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-04 15:56:10 -0500
committerJune McEnroe <june@causal.agency>2018-12-04 15:56:10 -0500
commit638be4e7757a7e7fcb52332461b5b1b5330a6771 (patch)
tree14190aec10060e1d8b9a3af6bc95b56781590cda /handle.c
parentSend only SIGHUP in sandman (diff)
downloadcatgirl-638be4e7757a7e7fcb52332461b5b1b5330a6771.tar.gz
catgirl-638be4e7757a7e7fcb52332461b5b1b5330a6771.zip
Show error if disconnected unintentionally
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/handle.c b/handle.c
index 137f859..3b52f0c 100644
--- a/handle.c
+++ b/handle.c
@@ -95,11 +95,14 @@ static void handlePing(char *prefix, char *params) {
 }
 
 static void handleError(char *prefix, char *params) {
-	(void)prefix;
-	(void)params;
-	// TODO: Show error if unintended disconnect.
-	uiExit();
-	exit(EX_OK);
+	char *mesg;
+	parse(prefix, NULL, NULL, NULL, params, 1, 0, &mesg);
+	if (self.quit) {
+		uiExit();
+		exit(EX_OK);
+	} else {
+		errx(EX_PROTOCOL, "%s", mesg);
+	}
 }
 
 static void handleErrorErroneousNickname(char *prefix, char *params) {