From fed791ed9100552edbe643d8b3d0e0bc271e88d4 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Mon, 30 Oct 2017 17:41:16 +0100 Subject: Fix a problem with multiline responses Do not clear the whole table every time a response is received. --- src/irc/core/irc-cap.c | 8 ++++++-- src/irc/core/irc-servers.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/irc/core/irc-cap.c b/src/irc/core/irc-cap.c index 880a15b6..90bffd80 100644 --- a/src/irc/core/irc-cap.c +++ b/src/irc/core/irc-cap.c @@ -148,8 +148,12 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add caps_length = g_strv_length(caps); if (!g_ascii_strcasecmp(evt, "LS")) { - /* Throw away everything and start from scratch */ - g_hash_table_remove_all(server->cap_supported); + if (!server->cap_in_multiline) { + /* Throw away everything and start from scratch */ + g_hash_table_remove_all(server->cap_supported); + } + + server->cap_in_multiline = multiline; /* Create a list of the supported caps */ for (i = 0; i < caps_length; i++) { diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h index 6c6002c8..1374e846 100644 --- a/src/irc/core/irc-servers.h +++ b/src/irc/core/irc-servers.h @@ -68,6 +68,7 @@ struct _IRC_SERVER_REC { unsigned int motd_got:1; /* We've received MOTD */ unsigned int isupport_sent:1; /* Server has sent us an isupport reply */ unsigned int cap_complete:1; /* We've done the initial CAP negotiation */ + unsigned int cap_in_multiline:1; /* We're waiting for the multiline response to end */ unsigned int sasl_success:1; /* Did we authenticate successfully ? */ int max_kicks_in_cmd; /* max. number of people to kick with one /KICK command */ -- cgit v1.2.3