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 906: /* registration completes before SASL 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);
PrintTextf (sess, "%s\n", ++word_eol[4]);
break;
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)
{
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);
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)
{
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)
{
tcp_send_len (serv, "CAP REQ :identify-msg\r\n", 23);