Package: xchat / 2.8.8-17

51_freenode_ircd-seven.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## 51_freenode_ircd-seven.dpatch by Terence Simpson <tsimpson@kubuntu.org>
##
## Origin: http://adipose.attenuate.org/~stephen/ircd-seven/xchat-ircd-seven-identify-msg.patch.txt
## Description: Add support for ircd-seven CAP command.
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -45,6 +45,7 @@
 {
 	if (serv->password[0])
 		tcp_sendf (serv, "PASS %s\r\n", serv->password);
+	tcp_sendf (serv, "CAP LS\r\n");
 
 	tcp_sendf (serv,
 				  "NICK %s\r\n"
@@ -1109,6 +1110,38 @@
 			return;
 		}
 	}
+
+	else if (len == 3)
+	{
+		guint32 t;
+
+		t = WORDL((guint8)type[0], (guint8)type[1], (guint8)type[2], (guint8)type[3]);
+		switch (t)
+		{
+		case WORDL('C','A','P','\0'):
+			if (strncasecmp(word[4], "ACK", 3) == 0)
+			{
+				if (strncasecmp(word[5][0]==':' ? word[5]+1 : word[5],
+					"identify-msg", 12) == 0)
+				{
+					serv->have_idmsg = TRUE;
+					tcp_send_len(serv, "CAP END\r\n", 9);
+				}
+			}
+			else if (strncasecmp(word[4], "LS", 2) == 0)
+			{
+				if (strstr(word_eol[5], "identify-msg") != 0)
+					tcp_send_len(serv, "CAP REQ :identify-msg\r\n", 23);
+				else
+					tcp_send_len(serv, "CAP END\r\n", 9);
+			}
+			else if (strncasecmp(word[4], "NAK",3) == 0)
+			{
+				tcp_send_len(serv, "CAP END\r\n", 9);
+			}
+			return;
+		}
+	}
 
 garbage:
 	/* unknown message */