Implement support for IRCv3.1 CAP negotiation

This commit is contained in:
LemonBoy 2015-02-12 00:07:22 +01:00
commit 2d7030a844
9 changed files with 238 additions and 1 deletions

View file

@ -32,6 +32,7 @@
#include "irc-queries.h"
#include "irc-servers-setup.h"
#include "irc-servers.h"
#include "irc-cap.h"
#include "channel-rejoin.h"
#include "servers-idle.h"
#include "servers-reconnect.h"
@ -201,6 +202,8 @@ static void server_init(IRC_SERVER_REC *server)
conn = server->connrec;
irc_send_cmd_now(server, "CAP LS");
if (conn->proxy != NULL && conn->proxy_password != NULL &&
*conn->proxy_password != '\0') {
cmd = g_strdup_printf("PASS %s", conn->proxy_password);
@ -409,7 +412,16 @@ static void sig_disconnected(IRC_SERVER_REC *server)
server_redirect_destroy(tmp->next->data);
}
g_slist_free(server->cmdqueue);
server->cmdqueue = NULL;
server->cmdqueue = NULL;
gslist_free_full(server->cap_active, (GDestroyNotify) g_free);
server->cap_active = NULL;
gslist_free_full(server->cap_supported, (GDestroyNotify) g_free);
server->cap_supported = NULL;
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free);
server->cap_queue = NULL;
/* these are dynamically allocated only if isupport was sent */
g_hash_table_foreach(server->isupport,