about summary refs log tree commit diff
path: root/chat.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-02 17:37:36 -0500
committerJune McEnroe <june@causal.agency>2020-02-02 17:37:36 -0500
commit0d6a60cc6634cafe03671e9d5a1a64295c98bb9d (patch)
treec0040a6be92fba5aae7670d67ff3f1673edb4ba2 /chat.h
parentHandle notices and actions (diff)
downloadcatgirl-0d6a60cc6634cafe03671e9d5a1a64295c98bb9d.tar.gz
catgirl-0d6a60cc6634cafe03671e9d5a1a64295c98bb9d.zip
Save NETWORK, CHANTYPES, PREFIX from ISUPPORT
Diffstat (limited to '')
-rw-r--r--chat.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/chat.h b/chat.h
index 275fef9..f9de779 100644
--- a/chat.h
+++ b/chat.h
@@ -65,12 +65,21 @@ enum Cap {
 
 extern struct Self {
 	bool debug;
+	char *plain;
 	const char *join;
 	enum Cap caps;
-	char *plain;
+	char *network;
+	char *chanTypes;
+	char *prefixes;
 	char *nick;
 } self;
 
+static inline void set(char **field, const char *value) {
+	free(*field);
+	*field = strdup(value);
+	if (!*field) err(EX_OSERR, "strdup");
+}
+
 #define ENUM_TAG \
 	X("time", TagTime)