summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-10 05:50:28 -0500
committerJune McEnroe <june@causal.agency>2020-02-10 05:50:28 -0500
commit0d93e66a68ded28440e20cd7012b4e8b0c705fc6 (patch)
tree110b83877027e09361e2d361e94a57ead6524fca /chat.c
parentHash to colors in the range 2-75 (diff)
downloadcatgirl-0d93e66a68ded28440e20cd7012b4e8b0c705fc6.tar.gz
catgirl-0d93e66a68ded28440e20cd7012b4e8b0c705fc6.zip
Add -H
Diffstat (limited to 'chat.c')
-rw-r--r--chat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/chat.c b/chat.c
index ff74485..c58fdc5 100644
--- a/chat.c
+++ b/chat.c
@@ -21,6 +21,7 @@
 #include <poll.h>
 #include <signal.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -46,6 +47,8 @@ size_t idNext = Network + 1;
 
 struct Self self = { .color = Default };
 
+uint32_t hashInit;
+
 int procPipe[2] = { -1, -1 };
 
 static void pipeRead(void) {
@@ -81,10 +84,11 @@ int main(int argc, char *argv[]) {
 	const char *user = NULL;
 	const char *real = NULL;
 
-	const char *Opts = "!C:O:a:c:eh:j:k:n:p:r:u:vw:";
+	const char *Opts = "!C:H:O:a:c:eh:j:k:n:p:r:u:vw:";
 	const struct option LongOpts[] = {
 		{ "insecure", no_argument, NULL, '!' },
 		{ "copy", required_argument, NULL, 'C' },
+		{ "hash", required_argument, NULL, 'H' },
 		{ "open", required_argument, NULL, 'O' },
 		{ "sasl-plain", required_argument, NULL, 'a' },
 		{ "cert", required_argument, NULL, 'c' },
@@ -106,6 +110,7 @@ int main(int argc, char *argv[]) {
 		switch (opt) {
 			break; case '!': insecure = true;
 			break; case 'C': urlCopyUtil = optarg;
+			break; case 'H': hashInit = strtoul(optarg, NULL, 0);
 			break; case 'O': urlOpenUtil = optarg;
 			break; case 'a': sasl = true; self.plain = optarg;
 			break; case 'c': cert = optarg;
n Hesse 2019-05-20ui-shared: restrict to 15 levelsJason A. Donenfeld 2019-02-23ui-diff,ui-tag: don't use htmlf with non-formatted stringsChris Mayo 2019-02-23ui-ssdiff: resolve HTML5 validation errorsChris Mayo 2019-01-03filters: migrate from luacrypto to luaosslJason A. Donenfeld 2019-01-02ui-shared: fix broken sizeof in title setting and rewriteJason A. Donenfeld 2018-12-09git: update to v2.20.0Christian Hesse 2018-11-25ui-blame: set repo for sbJason A. Donenfeld 2018-11-25auth-filter: pass url with query string attachedJason A. Donenfeld 2018-11-21git: use xz compressed archive for downloadChristian Hesse 2018-10-12git: update to v2.19.1Christian Hesse 2018-09-11ui-ssdiff: ban strcat()Christian Hesse 2018-09-11ui-ssdiff: ban strncpy()Christian Hesse 2018-09-11ui-shared: ban strcat()Christian Hesse 2018-09-11ui-patch: ban sprintf()Christian Hesse 2018-09-11ui-log: ban strncpy()Christian Hesse 2018-09-11ui-log: ban strcpy()Christian Hesse 2018-09-11parsing: ban sprintf()Christian Hesse 2018-09-11parsing: ban strncpy()Christian Hesse 2018-08-28filters: generate anchor links from markdownChristian Hesse 2018-08-03Bump version.Jason A. Donenfeld 2018-08-03clone: fix directory traversalJason A. Donenfeld 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev