diff options
author | dx <dx@dxzone.com.ar> | 2015-10-03 22:15:17 -0300 |
---|---|---|
committer | dx <dx@dxzone.com.ar> | 2015-10-03 22:15:17 -0300 |
commit | 15a40ea6d34ac159dd7cc80bcee38ff3c0850a01 (patch) | |
tree | 9c843bef53ccaff3014e1a6ac24d095c60ff54ad /src/irc | |
parent | 48375c3f900f56434441caa0161c0531fd0ce435 (diff) | |
parent | a475d57183bcbfd6e540dba5cd7894d8c38b53b7 (diff) | |
download | irssi-15a40ea6d34ac159dd7cc80bcee38ff3c0850a01.zip |
Merge pull request #314 from LemonBoy/sasl_session
Save the sasl state in the session
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-session.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/irc/core/irc-session.c b/src/irc/core/irc-session.c index ea65d8a5..18e8e5c7 100644 --- a/src/irc/core/irc-session.c +++ b/src/irc/core/irc-session.c @@ -28,6 +28,8 @@ #include "irc-channels.h" #include "irc-nicklist.h" +#include "sasl.h" + struct _isupport_data { CONFIG_REC *config; CONFIG_NODE *node; }; static void session_isupport_foreach(char *key, char *value, struct _isupport_data *data) @@ -65,6 +67,10 @@ static void sig_session_save_server(IRC_SERVER_REC *server, CONFIG_REC *config, config_node_set_str(config, node, "away_reason", server->away_reason); config_node_set_bool(config, node, "emode_known", server->emode_known); + config_node_set_int(config, node, "sasl_mechanism", server->connrec->sasl_mechanism); + config_node_set_str(config, node, "sasl_username", server->connrec->sasl_username); + config_node_set_str(config, node, "sasl_password", server->connrec->sasl_password); + config_node_set_bool(config, node, "isupport_sent", server->isupport_sent); isupport = config_node_section(config, node, "isupport", NODE_TYPE_BLOCK); isupport_data.config = config; @@ -90,6 +96,15 @@ static void sig_session_restore_server(IRC_SERVER_REC *server, server->emode_known = config_node_get_bool(node, "emode_known", FALSE); server->isupport_sent = config_node_get_bool(node, "isupport_sent", FALSE); + server->connrec->sasl_mechanism = config_node_get_int(node, "sasl_mechanism", SASL_MECHANISM_NONE); + /* The fields below might have been filled when loading the chatnet + * description from the config and we favor the content that's been saved + * in the session file over that. */ + g_free(server->connrec->sasl_username); + server->connrec->sasl_username = g_strdup(config_node_get_str(node, "sasl_username", NULL)); + g_free(server->connrec->sasl_password); + server->connrec->sasl_password = g_strdup(config_node_get_str(node, "sasl_password", NULL)); + if (server->isupport == NULL) { server->isupport = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal); |