From e0ff13f6c17acd61a2123737688042703a2f7a42 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Mon, 12 Aug 2019 17:07:17 +0200 Subject: [PATCH 1/2] enable irc cap ls 302 --- src/irc/core/irc-servers.c | 2 +- src/irc/core/irc-servers.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 7057c02a..8a7137eb 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -240,7 +240,7 @@ static void server_init(IRC_SERVER_REC *server) irc_cap_toggle(server, "multi-prefix", TRUE); - irc_send_cmd_now(server, "CAP LS"); + irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION); if (conn->password != NULL && *conn->password != '\0') { /* send password */ diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h index 57b65527..162d845f 100644 --- a/src/irc/core/irc-servers.h +++ b/src/irc/core/irc-servers.h @@ -5,6 +5,8 @@ #include #include +#define CAP_LS_VERSION "302" + /* returns IRC_SERVER_REC if it's IRC server, NULL if it isn't */ #define IRC_SERVER(server) \ PROTO_CHECK_CAST(SERVER(server), IRC_SERVER_REC, chat_type, "IRC") From d512647b3f4b769305e3515d616833988d918943 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 13 Aug 2019 17:36:20 +0200 Subject: [PATCH 2/2] use symbolic defines for capability strings --- src/irc/core/irc-servers.c | 4 ++-- src/irc/core/irc-servers.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 8a7137eb..118f7242 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -236,9 +236,9 @@ static void server_init(IRC_SERVER_REC *server) } if (conn->sasl_mechanism != SASL_MECHANISM_NONE) - irc_cap_toggle(server, "sasl", TRUE); + irc_cap_toggle(server, CAP_SASL, TRUE); - irc_cap_toggle(server, "multi-prefix", TRUE); + irc_cap_toggle(server, CAP_MULTI_PREFIX, TRUE); irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION); diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h index 162d845f..df0446cb 100644 --- a/src/irc/core/irc-servers.h +++ b/src/irc/core/irc-servers.h @@ -6,6 +6,8 @@ #include #define CAP_LS_VERSION "302" +#define CAP_SASL "sasl" +#define CAP_MULTI_PREFIX "multi-prefix" /* returns IRC_SERVER_REC if it's IRC server, NULL if it isn't */ #define IRC_SERVER(server) \