aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-20 13:08:40 -0300
committerdequis <dx@dxzone.com.ar>2015-11-20 13:13:35 -0300
commit8fdeaa5b32142e7c1095eaf76720d116c4bc7d37 (patch)
tree35a92ac654db0a79a0a26dd39a4e6753ea6f1782
parent80c2f3c775d7a7dd5a59068f1cefe55370f56529 (diff)
IRCv3 cap-3.2/sasl-3.2 capabilities (just send sasl mechanism list)
Nothing else needed, i think. No need for multiline replies, cap-notify, sasl reauthentication just works, and the authentication layer is always available.
-rw-r--r--irc_cap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/irc_cap.c b/irc_cap.c
index 76935d26..65d9b2ef 100644
--- a/irc_cap.c
+++ b/irc_cap.c
@@ -110,8 +110,8 @@ static gboolean irc_cmd_cap_req(irc_t *irc, char *caps)
return TRUE;
}
-/* version can be "302" or NULL, but we don't need cap-3.2 for anything yet */
-static void irc_cmd_cap_ls(irc_t *irc, char *version)
+/* version can be 0, 302, 303, or garbage from user input. thanks user input */
+static void irc_cmd_cap_ls(irc_t *irc, long version)
{
int i;
GString *str = g_string_sized_new(256);
@@ -121,6 +121,10 @@ static void irc_cmd_cap_ls(irc_t *irc, char *version)
g_string_append_c(str, ' ');
}
g_string_append(str, supported_caps[i].name);
+
+ if (version >= 302 && supported_caps[i].flag == CAP_SASL) {
+ g_string_append(str, "=PLAIN");
+ }
}
irc_send_cap(irc, "LS", str->str);
@@ -160,7 +164,7 @@ void irc_cmd_cap(irc_t *irc, char **cmd)
}
if (g_strcasecmp(cmd[1], "LS") == 0) {
- irc_cmd_cap_ls(irc, cmd[2]);
+ irc_cmd_cap_ls(irc, cmd[2] ? strtol(cmd[2], NULL, 10) : 0);
} else if (g_strcasecmp(cmd[1], "LIST") == 0) {
irc_cmd_cap_list(irc);