mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 01:33:12 +02:00
irc: add server option "registered_mode" (closes #1625)
Two new fields are added in IRC server structure:
- "authentication_method", possible values:
0: not authenticated
1: authenticated with SASL
2: authenticated with other method
- "sasl_mechanism_used", possible values: see enum t_irc_sasl_mechanism
in src/plugins/irc/irc-sasl.h
This commit is contained in:
committed by
Sébastien Helleu
parent
3909d77617
commit
4f0b6115a1
@@ -571,6 +571,10 @@ IRC_PROTOCOL_CALLBACK(authenticate)
|
||||
IRC_PLUGIN_NAME,
|
||||
sasl_error);
|
||||
}
|
||||
else
|
||||
{
|
||||
server->sasl_mechanism_used = sasl_mechanism;
|
||||
}
|
||||
irc_server_sendf (server, 0, NULL, "AUTHENTICATE %s", answer);
|
||||
free (answer);
|
||||
}
|
||||
@@ -7281,6 +7285,8 @@ IRC_PROTOCOL_CALLBACK(sasl_end_ok)
|
||||
|
||||
IRC_PROTOCOL_RUN_CALLBACK(numeric);
|
||||
|
||||
server->authentication_method = IRC_SERVER_AUTH_METHOD_SASL;
|
||||
|
||||
if (!server->is_connected)
|
||||
irc_server_sendf (server, 0, NULL, "CAP END");
|
||||
|
||||
@@ -7306,6 +7312,9 @@ IRC_PROTOCOL_CALLBACK(sasl_end_fail)
|
||||
server->hook_timer_sasl = NULL;
|
||||
}
|
||||
|
||||
server->authentication_method = IRC_SERVER_AUTH_METHOD_NONE;
|
||||
server->sasl_mechanism_used = -1;
|
||||
|
||||
IRC_PROTOCOL_RUN_CALLBACK(numeric);
|
||||
|
||||
sasl_fail = IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SASL_FAIL);
|
||||
|
||||
Reference in New Issue
Block a user