summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-11-03 07:46:51 +0100
committerBerke Viktor <bviktor@hexchat.org>2012-11-03 07:46:51 +0100
commita9c7e40b5b7d7d2575d9238d6dc8f3dce8e4c6b3 (patch)
treeb581d4e45d5c4a509e9e0cb1fe8257a2d5f29a06 /src/common
parent80fdce76c4ab20b8a94c96e009e061dbe5494936 (diff)
Add text events for CAP ACK/REQ
Diffstat (limited to 'src/common')
-rw-r--r--src/common/proto-irc.c8
-rw-r--r--src/common/text.c19
-rw-r--r--src/common/textevents.in24
3 files changed, 39 insertions, 12 deletions
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 2b83e992..4a64bed6 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1138,6 +1138,9 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
 			case WORDL('C','A','P','\0'):
 				if (strncasecmp (word[4], "ACK", 3) == 0)
 				{
+					/* should acknowledge only one at a time, but just make sure we don't miss anything, use word_eol */
+					EMIT_SIGNAL (XP_TE_CAPACK, sess->server->server_session, word[1], ++word_eol[5], NULL, NULL, 0);
+
 					if (strncasecmp (word[5][0]==':' ? word[5] + 1 : word[5], "identify-msg", 12) == 0)
 					{
 						serv->have_idmsg = TRUE;
@@ -1155,15 +1158,18 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
 				}
 				else if (strncasecmp (word[4], "LS", 2) == 0)
 				{
-					EMIT_SIGNAL (XP_TE_SERVERCAP, serv->server_session, word[1], ++word_eol[5], NULL, NULL, 0);
+					EMIT_SIGNAL (XP_TE_CAPLIST, serv->server_session, word[1], ++word_eol[5], NULL, NULL, 0);
+
 					if (strstr (word_eol[5], "identify-msg") != 0)
 					{
+						EMIT_SIGNAL (XP_TE_CAPREQ, sess->server->server_session, "identify-msg", NULL, NULL, NULL, 0);
 						tcp_send_len (serv, "CAP REQ :identify-msg\r\n", 23);
 					}
 
 					/* if the SASL password is set, request SASL auth */
 					if (strstr (word_eol[5], "sasl") != 0 && strlen (sess->server->saslpassword) != 0)
 					{
+						EMIT_SIGNAL (XP_TE_CAPREQ, sess->server->server_session, "sasl", NULL, NULL, NULL, 0);
 						tcp_send_len (serv, "CAP REQ :sasl\r\n", 23);
 					}
 					else
diff --git a/src/common/text.c b/src/common/text.c
index 2e6cb86a..83c5ca98 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -1169,6 +1169,20 @@ static char * const pevt_privmsg_help[] = {
 	N_("Identified text")
 };
 
+static char * const pevt_capack_help[] = {
+	N_("Server Name"),
+	N_("Acknowledged Capability")
+};
+
+static char * const pevt_caplist_help[] = {
+	N_("Server Name"),
+	N_("Server Capabilities")
+};
+
+static char * const pevt_capreq_help[] = {
+	N_("Requested Capability")
+};
+
 static char * const pevt_changenick_help[] = {
 	N_("Old nickname"),
 	N_("New nickname"),
@@ -1422,11 +1436,6 @@ static char * const pevt_saslresponse_help[] = {
 	N_("Message")
 };
 
-static char * const pevt_servercap_help[] = {
-	N_("Server Name"),
-	N_("Server Capabilities")
-};
-
 static char * const pevt_servertext_help[] = {
 	N_("Text"),
 	N_("Server Name"),
diff --git a/src/common/textevents.in b/src/common/textevents.in
index 71309964..08c9bc01 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -22,6 +22,24 @@ pevt_generic_none_help
 
 n0
 
+Capability Acknowledgement
+XP_TE_CAPACK
+pevt_capack_help
+%C29*%O$tCapability acknowledged: %C29$2%O
+2
+
+Capability List
+XP_TE_CAPLIST
+pevt_caplist_help
+%C23*%O$tCapabilities supported by the server: %C29$2%O
+2
+
+Capability Request
+XP_TE_CAPREQ
+pevt_capreq_help
+%C23*%O$tCapability requested: %C29$1%O
+1
+
 Change Nick
 XP_TE_CHANGENICK
 pevt_changenick_help
@@ -658,12 +676,6 @@ 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
 XP_TE_SERVERCONNECTED
 pevt_generic_none_help