mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
add nocap flag
This commit is contained in:
parent
61237ee6c0
commit
8a5d5d384e
10 changed files with 46 additions and 7 deletions
|
|
@ -1053,7 +1053,7 @@ void irc_commands_init(void)
|
|||
signal_add("whois end", (SIGNAL_FUNC) event_end_of_whois);
|
||||
signal_add("whowas event", (SIGNAL_FUNC) event_whowas);
|
||||
|
||||
command_set_options("connect", "+ircnet starttls disallow_starttls");
|
||||
command_set_options("connect", "+ircnet starttls disallow_starttls nocap");
|
||||
command_set_options("topic", "delete");
|
||||
command_set_options("list", "yes");
|
||||
command_set_options("away", "one all");
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ static void sig_server_connect_copy(SERVER_CONNECT_REC **dest,
|
|||
rec->sasl_password = g_strdup(src->sasl_password);
|
||||
rec->disallow_starttls = src->disallow_starttls;
|
||||
rec->starttls = src->starttls;
|
||||
rec->no_cap = src->no_cap;
|
||||
*dest = (SERVER_CONNECT_REC *) rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ static void sig_server_setup_fill_reconn(IRC_SERVER_CONNECT_REC *conn,
|
|||
conn->disallow_starttls = 1;
|
||||
else if (sserver->starttls == STARTTLS_ENABLED)
|
||||
conn->starttls = 1;
|
||||
if (sserver->no_cap)
|
||||
conn->no_cap = 1;
|
||||
}
|
||||
|
||||
static void sig_server_setup_fill_connect(IRC_SERVER_CONNECT_REC *conn, GHashTable *optlist)
|
||||
|
|
@ -77,6 +79,10 @@ static void sig_server_setup_fill_optlist(IRC_SERVER_CONNECT_REC *conn, GHashTab
|
|||
} else if (g_hash_table_lookup(optlist, "disallow_starttls") != NULL) {
|
||||
conn->disallow_starttls = 1;
|
||||
}
|
||||
if (g_hash_table_lookup(optlist, "nocap"))
|
||||
conn->no_cap = 1;
|
||||
if (g_hash_table_lookup(optlist, "cap"))
|
||||
conn->no_cap = 0;
|
||||
}
|
||||
|
||||
static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn,
|
||||
|
|
@ -195,6 +201,7 @@ static void sig_server_setup_read(IRC_SERVER_SETUP_REC *rec, CONFIG_NODE *node)
|
|||
if (rec->starttls == STARTTLS_ENABLED) {
|
||||
rec->use_tls = 0;
|
||||
}
|
||||
rec->no_cap = config_node_get_bool(node, "no_cap", FALSE);
|
||||
}
|
||||
|
||||
static void sig_server_setup_saved(IRC_SERVER_SETUP_REC *rec,
|
||||
|
|
@ -213,6 +220,8 @@ static void sig_server_setup_saved(IRC_SERVER_SETUP_REC *rec,
|
|||
iconfig_node_set_bool(node, "starttls", rec->starttls);
|
||||
else
|
||||
iconfig_node_set_str(node, "starttls", NULL);
|
||||
if (rec->no_cap)
|
||||
iconfig_node_set_bool(node, "no_cap", TRUE);
|
||||
}
|
||||
|
||||
void irc_servers_setup_init(void)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ typedef struct {
|
|||
int cmd_queue_speed;
|
||||
int max_query_chans;
|
||||
int starttls;
|
||||
int no_cap : 1;
|
||||
} IRC_SERVER_SETUP_REC;
|
||||
|
||||
void irc_servers_setup_init(void);
|
||||
|
|
|
|||
|
|
@ -309,11 +309,16 @@ static void server_init_1(IRC_SERVER_REC *server)
|
|||
server->wait_cmd = g_get_real_time();
|
||||
server->wait_cmd += 120 * G_USEC_PER_SEC;
|
||||
|
||||
irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION);
|
||||
/* to detect non-CAP servers, send this bogus join */
|
||||
irc_send_cmd_now(server, "JOIN ");
|
||||
if (!conn->no_cap) {
|
||||
signal_emit("server waiting cap ls", 2, server, CAP_LS_VERSION);
|
||||
irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION);
|
||||
/* to detect non-CAP servers, send this bogus join */
|
||||
irc_send_cmd_now(server, "JOIN ");
|
||||
}
|
||||
if (conn->starttls)
|
||||
irc_server_send_starttls(server);
|
||||
else if (conn->no_cap)
|
||||
server_init_2(server);
|
||||
}
|
||||
|
||||
static void init_ssl_loop(IRC_SERVER_REC *server, GIOChannel *handle)
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ struct _IRC_SERVER_CONNECT_REC {
|
|||
int max_kicks, max_msgs, max_modes, max_whois;
|
||||
int disallow_starttls:1;
|
||||
int starttls:1;
|
||||
int no_cap:1;
|
||||
};
|
||||
/* clang-format on */
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ static void sig_session_save_server(IRC_SERVER_REC *server, CONFIG_REC *config,
|
|||
server->connrec->starttls ? STARTTLS_ENABLED :
|
||||
STARTTLS_NOTSET);
|
||||
|
||||
config_node_set_bool(config, node, "no_cap", server->connrec->no_cap);
|
||||
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;
|
||||
|
|
@ -115,6 +116,7 @@ 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->no_cap = config_node_get_bool(node, "no_cap", 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue