summary refs log tree commit diff
path: root/bin/downgrade.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/downgrade.c')
-rw-r--r--bin/downgrade.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/downgrade.c b/bin/downgrade.c
index 3548efcf..ee7c4a7e 100644
--- a/bin/downgrade.c
+++ b/bin/downgrade.c
@@ -120,6 +120,16 @@ static void handle(char *ptr) {
 		format("NICK %s_\r\n", nick);
 	} else if (!strcmp(cmd, "001")) {
 		if (join) format("JOIN %s\r\n", join);
+	} else if (!strcmp(cmd, "005")) {
+		char *self = strsep(&ptr, " ");
+		if (!self) errx(EX_PROTOCOL, "RPL_ISUPPORT missing nick");
+		while (ptr && *ptr != ':') {
+			char *tok = strsep(&ptr, " ");
+			char *key = strsep(&tok, "=");
+			if (!strcmp(key, "BOT") && tok) {
+				format("MODE %s +%s\r\n", self, tok);
+			}
+		}
 	} else if (!strcmp(cmd, "INVITE") && invite) {
 		strsep(&ptr, " ");
 		if (!ptr) errx(EX_PROTOCOL, "INVITE missing channel");