summary refs log tree commit diff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/server.c b/server.c
index 1583d1c..5e23a71 100644
--- a/server.c
+++ b/server.c
@@ -91,7 +91,7 @@ void serverSend(const char *ptr, size_t len) {
 	}
 }
 
-static void format(const char *format, ...) {
+void serverFormat(const char *format, ...) {
 	char buf[513];
 	va_list ap;
 	va_start(ap, format);
@@ -141,7 +141,7 @@ void serverLogin(
 	const char *pass, const char *auth,
 	const char *nick, const char *user, const char *real
 ) {
-	if (pass) format("PASS :%s\r\n", pass);
+	if (pass) serverFormat("PASS :%s\r\n", pass);
 	if (auth) {
 		byte plain[1 + strlen(auth)];
 		plain[0] = 0;
@@ -149,22 +149,20 @@ void serverLogin(
 			plain[1 + i] = (auth[i] == ':' ? 0 : auth[i]);
 		}
 		authBase64 = base64(plain, sizeof(plain));
-		format("CAP REQ :sasl\r\n");
+		serverFormat("CAP REQ :sasl\r\n");
 	}
-	format("NICK %s\r\nUSER %s 0 * :%s\r\n", nick, user, real);
+	serverFormat("NICK %s\r\nUSER %s 0 * :%s\r\n", nick, user, real);
 }
 
 void serverAuth(void) {
 	assert(authBase64);
-	format("AUTHENTICATE PLAIN\r\nAUTHENTICATE %s\r\nCAP END\r\n", authBase64);
+	serverFormat(
+		"AUTHENTICATE PLAIN\r\nAUTHENTICATE %s\r\nCAP END\r\n", authBase64
+	);
 	free(authBase64);
 	authBase64 = NULL;
 }
 
-void serverJoin(const char *join) {
-	format("JOIN :%s\r\n", join);
-}
-
 void serverRecv(void) {
 	static char buf[4096];
 	static size_t len;
@@ -185,7 +183,7 @@ void serverRecv(void) {
 		if (verbose) fprintf(stderr, "\x1B[32m%s\x1B[m\n", line);
 		if (!strncmp(line, "PING ", 5)) {
 			line[1] = 'O';
-			format("%s\r\n", line);
+			serverFormat("%s\r\n", line);
 		} else {
 			// TODO: Add line to ring if stateReady().
 			stateParse(line);
/commit/bin/man1/htagml.1?id=e886fbb30f1b157aa4daba9cda6ca13186a760d8&follow=1'>Add hilex example to htagml manualJune McEnroe 2021-01-12Style causal.agency like bin HTMLJune McEnroe 2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe 2021-01-12Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe