summary refs log tree commit diff
path: root/bounce.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-27 02:36:32 -0500
committerJune McEnroe <june@causal.agency>2020-02-27 02:36:32 -0500
commit793f564ffd9622e2c879b1ee3591748d602d6118 (patch)
treecc556825581fa1e81ccd4246ad84ae1f2d972970 /bounce.h
parentSupport cap-notify (diff)
downloadpounce-793f564ffd9622e2c879b1ee3591748d602d6118.tar.gz
pounce-793f564ffd9622e2c879b1ee3591748d602d6118.zip
Support CAP LS 302 from clients
Diffstat (limited to '')
-rw-r--r--bounce.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/bounce.h b/bounce.h
index 1655772..5aff027 100644
--- a/bounce.h
+++ b/bounce.h
@@ -87,7 +87,9 @@ enum Cap {
 #define X(name, id) BIT(id),
 	ENUM_CAP
 #undef X
-	TagCaps = CapAccountTag
+	CapBits,
+	TagCaps = 0
+		| CapAccountTag
 		| CapBatch
 		| CapLabeledResponse
 		| CapMessageTags
@@ -118,13 +120,17 @@ static inline enum Cap capParse(const char *list) {
 	return caps;
 }
 
-static inline const char *capList(enum Cap caps) {
+static inline const char *capList(enum Cap caps, const char *values[CapBits]) {
 	static char buf[1024];
 	buf[0] = '\0';
 	for (size_t i = 0; i < ARRAY_LEN(CapNames); ++i) {
 		if (caps & (1 << i)) {
 			if (buf[0]) strlcat(buf, " ", sizeof(buf));
 			strlcat(buf, CapNames[i], sizeof(buf));
+			if (values && values[i]) {
+				strlcat(buf, "=", sizeof(buf));
+				strlcat(buf, values[i], sizeof(buf));
+			}
 		}
 	}
 	return buf;