1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-26 19:22:22 -05:00

Provide text events for SASL auth, SASL responses and server capabilities

This commit is contained in:
Berke Viktor 2012-11-03 04:45:32 +01:00
parent 432f0781c4
commit 58adceb4e9
3 changed files with 37 additions and 3 deletions

View File

@ -886,8 +886,8 @@ process_numeric (session * sess, int n,
case 905: /* failed SASL auth */ case 905: /* failed SASL auth */
case 906: /* registration completes before SASL auth */ case 906: /* registration completes before SASL auth */
case 907: /* attempting to re-auth after a successful auth */ case 907: /* attempting to re-auth after a successful auth */
EMIT_SIGNAL (XP_TE_SASLRESPONSE, serv->server_session, word[1], word[2], word[3], ++word_eol[4], 0);
tcp_send_len (serv, "CAP END\r\n", 9); tcp_send_len (serv, "CAP END\r\n", 9);
PrintTextf (sess, "%s\n", ++word_eol[4]);
break; break;
default: default:
@ -1145,7 +1145,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
if (strncasecmp (word[5][0]==':' ? word[5] + 1 : word[5], "sasl", 12) == 0) if (strncasecmp (word[5][0]==':' ? word[5] + 1 : word[5], "sasl", 12) == 0)
{ {
serv->have_sasl = TRUE; serv->have_sasl = TRUE;
PrintTextf (sess, "Authenticating via SASL as %s\n", sess->server->sasluser); EMIT_SIGNAL (XP_TE_SASLAUTH, serv->server_session, sess->server->sasluser, NULL, NULL, NULL, 0);
tcp_send_len (serv, "AUTHENTICATE PLAIN\r\n", 20); tcp_send_len (serv, "AUTHENTICATE PLAIN\r\n", 20);
pass = encode_sasl_pass (sess->server->sasluser, sess->server->saslpassword); pass = encode_sasl_pass (sess->server->sasluser, sess->server->saslpassword);
@ -1155,7 +1155,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
} }
else if (strncasecmp (word[4], "LS", 2) == 0) else if (strncasecmp (word[4], "LS", 2) == 0)
{ {
PrintTextf (sess, "Capabilities supported by the server: %s\n", ++word_eol[5]); EMIT_SIGNAL (XP_TE_SERVERCAP, serv->server_session, word[1], ++word_eol[5], NULL, NULL, 0);
if (strstr (word_eol[5], "identify-msg") != 0) if (strstr (word_eol[5], "identify-msg") != 0)
{ {
tcp_send_len (serv, "CAP REQ :identify-msg\r\n", 23); tcp_send_len (serv, "CAP REQ :identify-msg\r\n", 23);

View File

@ -1411,6 +1411,22 @@ static char * const pevt_generic_channel_help[] = {
N_("Channel Name"), N_("Channel Name"),
}; };
static char * const pevt_saslauth_help[] = {
N_("Username")
};
static char * const pevt_saslresponse_help[] = {
N_("Server Name"),
N_("Raw Numeric or Identifier"),
N_("Username"),
N_("Message")
};
static char * const pevt_servercap_help[] = {
N_("Server Name"),
N_("Server Capabilities")
};
static char * const pevt_servertext_help[] = { static char * const pevt_servertext_help[] = {
N_("Text"), N_("Text"),
N_("Server Name"), N_("Server Name"),

View File

@ -646,6 +646,24 @@ pevt_resolvinguser_help
%C24*%O$tLooking up IP number for %C18$1%O... %C24*%O$tLooking up IP number for %C18$1%O...
2 2
SASL Authenticating
XP_TE_SASLAUTH
pevt_saslauth_help
%C23*%O$tAuthenticating via SASL as %C29$1%O
1
SASL Response
XP_TE_SASLRESPONSE
pevt_saslresponse_help
%C29*%O$t$4
n4
Server Capabilities
XP_TE_SERVERCAP
pevt_servercap_help
%C23*%O$tCapabilities supported by the server: %C29$2%O
2
Server Connected Server Connected
XP_TE_SERVERCONNECTED XP_TE_SERVERCONNECTED
pevt_generic_none_help pevt_generic_none_help