summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--bounce.h1
-rw-r--r--client.c13
-rw-r--r--pounce.13
3 files changed, 16 insertions, 1 deletions
diff --git a/bounce.h b/bounce.h
index e304055..8480d75 100644
--- a/bounce.h
+++ b/bounce.h
@@ -60,6 +60,7 @@ static inline struct Message parse(char *line) {
 	X("account-notify", CapAccountNotify) \
 	X("away-notify", CapAwayNotify) \
 	X("chghost", CapChghost) \
+	X("extended-join", CapExtendedJoin) \
 	X("sasl", CapSASL) \
 	X("server-time", CapServerTime) \
 	X("", CapUnsupported)
diff --git a/client.c b/client.c
index ec07b91..3ea00c8 100644
--- a/client.c
+++ b/client.c
@@ -299,10 +299,23 @@ static const char *filterChghost(const char *line) {
 	return (strcmp(cmd(line), "CHGHOST") ? line : NULL);
 }
 
+static const char *filterExtendedJoin(const char *line) {
+	if (strcmp(cmd(line), "JOIN")) return line;
+	size_t len = 0;
+	for (int i = 0; i < 3; ++i) {
+		len += strcspn(&line[len], " ");
+		if (line[len]) len++;
+	}
+	static char buf[512];
+	snprintf(buf, sizeof(buf), "%.*s", (int)len, line);
+	return buf;
+}
+
 static Filter *Filters[] = {
 	[CapAccountNotifyBit] = filterAccountNotify,
 	[CapAwayNotifyBit] = filterAwayNotify,
 	[CapChghostBit] = filterChghost,
+	[CapExtendedJoinBit] = filterExtendedJoin,
 };
 
 void clientConsume(struct Client *client) {
diff --git a/pounce.1 b/pounce.1
index 2fd7344..9477bbe 100644
--- a/pounce.1
+++ b/pounce.1
@@ -283,7 +283,8 @@ Pass-through of the following IRCv3 capabilities
 is supported:
 .Sy account-notify ,
 .Sy away-notify ,
-.Sy chghost .
+.Sy chghost ,
+.Sy extended-join .
 .
 .Ss Configuring SASL EXTERNAL
 .Bl -enum