summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-27 02:07:40 -0500
committerJune McEnroe <june@causal.agency>2020-02-27 02:07:40 -0500
commit0e519adaadf43bac33ac6caf3d37aed580724ea6 (patch)
tree1c3750f1ecb3cce5d12c978ad8a27f98ed1b963b /client.c
parentSupport setname (diff)
downloadpounce-0e519adaadf43bac33ac6caf3d37aed580724ea6.tar.gz
pounce-0e519adaadf43bac33ac6caf3d37aed580724ea6.zip
Support cap-notify
Diffstat (limited to '')
-rw-r--r--client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/client.c b/client.c
index c472f51..2d5b8e0 100644
--- a/client.c
+++ b/client.c
@@ -421,6 +421,13 @@ static const char *filterBatch(const char *line) {
 	return (wordcmp(line, 0, "BATCH") ? line : NULL);
 }
 
+static const char *filterCapNotify(const char *line) {
+	if (wordcmp(line, 0, "CAP")) return line;
+	if (!wordcmp(line, 1, "NEW")) return NULL;
+	if (!wordcmp(line, 1, "DEL")) return NULL;
+	return line;
+}
+
 static const char *filterChghost(const char *line) {
 	return (wordcmp(line, 0, "CHGHOST") ? line : NULL);
 }
@@ -488,6 +495,7 @@ static Filter *Filters[] = {
 	[CapAccountNotifyBit] = filterAccountNotify,
 	[CapAwayNotifyBit] = filterAwayNotify,
 	[CapBatchBit] = filterBatch,
+	[CapCapNotifyBit] = filterCapNotify,
 	[CapChghostBit] = filterChghost,
 	[CapExtendedJoinBit] = filterExtendedJoin,
 	[CapInviteNotifyBit] = filterInviteNotify,