|
|
697bea3 |
--- xchat-2.4.4/src/common/proto-irc.c.multiline 2005-06-27 08:35:54.000000000 -0400
|
|
|
697bea3 |
+++ xchat-2.4.4/src/common/proto-irc.c 2005-06-27 08:36:25.000000000 -0400
|
|
|
697bea3 |
@@ -824,6 +824,10 @@
|
|
|
697bea3 |
}
|
|
|
697bea3 |
if (!strcmp ("PRIVMSG", type))
|
|
|
697bea3 |
{
|
|
|
697bea3 |
+#define M_QUOTE '\020'
|
|
|
697bea3 |
+#define X_DELIM '\001'
|
|
|
697bea3 |
+#define X_QUOTE '\134'
|
|
|
697bea3 |
+
|
|
|
697bea3 |
char *to = word[3];
|
|
|
697bea3 |
int len;
|
|
|
697bea3 |
int id = FALSE; /* identified */
|
|
|
697bea3 |
@@ -842,17 +846,59 @@
|
|
|
697bea3 |
text++;
|
|
|
697bea3 |
}
|
|
|
697bea3 |
len = strlen (text);
|
|
|
697bea3 |
- if (text[0] == 1 && text[len - 1] == 1) /* ctcp */
|
|
|
697bea3 |
- {
|
|
|
697bea3 |
- text[len - 1] = 0;
|
|
|
697bea3 |
- text++;
|
|
|
697bea3 |
- if (strncasecmp (text, "ACTION", 6) != 0)
|
|
|
697bea3 |
- flood_check (nick, ip, serv, sess, 0);
|
|
|
697bea3 |
- if (strncasecmp (text, "DCC ", 4) == 0)
|
|
|
697bea3 |
- /* redo this with handle_quotes TRUE */
|
|
|
697bea3 |
- process_data_init (word[1], word_eol[1], word, word_eol, TRUE);
|
|
|
697bea3 |
- ctcp_handle (sess, to, nick, text, word, word_eol);
|
|
|
697bea3 |
- } else
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ { /* find and dequote low-level CTCP quoting */
|
|
|
697bea3 |
+ char *ptr = text;
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ while ((ptr = strchr(ptr, M_QUOTE)) != NULL) {
|
|
|
697bea3 |
+ switch(*(ptr+1)) {
|
|
|
697bea3 |
+ case 'r':
|
|
|
697bea3 |
+ *(ptr+1) = '\r';
|
|
|
697bea3 |
+ break;
|
|
|
697bea3 |
+ case 'n':
|
|
|
697bea3 |
+ *(ptr+1) = '\n';
|
|
|
697bea3 |
+ break;
|
|
|
697bea3 |
+ case '0':
|
|
|
697bea3 |
+ *(ptr+1) = 0;
|
|
|
697bea3 |
+ break;
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+ memmove(ptr, ptr+1, strlen(ptr+1)+1);
|
|
|
697bea3 |
+ ptr++;
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ { /* find, handle, and remove CTCP messages */
|
|
|
697bea3 |
+ char *start, *end;
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ while (((start = strchr(text, X_DELIM)) != NULL) && ((end = strchr(start+1, X_DELIM)) != NULL)) {
|
|
|
697bea3 |
+ *end = 0;
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ if (strncasecmp(start+1, "ACTION ", sizeof("ACTION ")-1) != 0)
|
|
|
697bea3 |
+ flood_check(nick, ip, serv, sess, 0);
|
|
|
697bea3 |
+ if (strncasecmp(text, "DCC ", sizeof("DCC ")-1) == 0)
|
|
|
697bea3 |
+ /* redo this with handle_quotes TRUE */
|
|
|
697bea3 |
+ process_data_init (word[1], word_eol[1], word, word_eol, TRUE);
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ { /* inline CTCP dequote */
|
|
|
697bea3 |
+ char *ptr = start+1;
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ while ((ptr = strchr(ptr, X_QUOTE)) != NULL) {
|
|
|
697bea3 |
+ switch(*(ptr+1)) {
|
|
|
697bea3 |
+ case 'a':
|
|
|
697bea3 |
+ *(ptr+1) = X_DELIM;
|
|
|
697bea3 |
+ break;
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+ memmove(ptr, ptr+1, strlen(ptr+1)+1);
|
|
|
697bea3 |
+ ptr++;
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ ctcp_handle(sess, to, nick, start+1, word, word_eol);
|
|
|
697bea3 |
+ memmove(start, end+1, strlen(end+1)+1);
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+ }
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+ if (*text != 0)
|
|
|
697bea3 |
{
|
|
|
697bea3 |
if (is_channel (serv, to))
|
|
|
697bea3 |
{
|
|
|
697bea3 |
--- xchat-2.4.4/src/common/ctcp.c.multiline 2005-06-27 08:35:44.000000000 -0400
|
|
|
697bea3 |
+++ xchat-2.4.4/src/common/ctcp.c 2005-06-27 08:39:15.000000000 -0400
|
|
|
697bea3 |
@@ -58,13 +58,15 @@
|
|
|
697bea3 |
struct popup *pop;
|
|
|
697bea3 |
GSList *list = ctcp_list;
|
|
|
697bea3 |
|
|
|
697bea3 |
- po = strchr (ctcp, '\001');
|
|
|
697bea3 |
- if (po)
|
|
|
697bea3 |
- *po = 0;
|
|
|
697bea3 |
-
|
|
|
697bea3 |
- po = strchr (word_eol[5], '\001');
|
|
|
697bea3 |
- if (po)
|
|
|
697bea3 |
- *po = 0;
|
|
|
697bea3 |
+// handled by PRIVMSG handler
|
|
|
697bea3 |
+// po = strchr (ctcp, '\001');
|
|
|
697bea3 |
+// if (po)
|
|
|
697bea3 |
+// *po = 0;
|
|
|
697bea3 |
+
|
|
|
697bea3 |
+// this appears to be superfluous, but I am not sure; leaving it uncommented causes breakage
|
|
|
697bea3 |
+// po = strchr (word_eol[5], '\001');
|
|
|
697bea3 |
+// if (po)
|
|
|
697bea3 |
+// *po = 0;
|
|
|
697bea3 |
|
|
|
697bea3 |
while (list)
|
|
|
697bea3 |
{
|
|
|
697bea3 |
@@ -129,7 +131,7 @@
|
|
|
697bea3 |
|
|
|
697bea3 |
if (!strcasecmp (msg, "VERSION") && !prefs.hidever)
|
|
|
697bea3 |
{
|
|
|
697bea3 |
- snprintf (outbuf, sizeof (outbuf), "VERSION xchat "VERSION" %s",
|
|
|
697bea3 |
+ snprintf (outbuf, sizeof (outbuf), "VERSION xchat:"VERSION":%s",
|
|
|
697bea3 |
get_cpu_str ());
|
|
|
697bea3 |
serv->p_nctcp (serv, nick, outbuf);
|
|
|
697bea3 |
}
|
|
|
697bea3 |
@@ -138,9 +140,10 @@
|
|
|
697bea3 |
{
|
|
|
697bea3 |
if (!strncasecmp (msg, "SOUND", 5))
|
|
|
697bea3 |
{
|
|
|
697bea3 |
- po = strchr (word[5], '\001');
|
|
|
697bea3 |
- if (po)
|
|
|
697bea3 |
- po[0] = 0;
|
|
|
697bea3 |
+// handled by PRIVMSG handler
|
|
|
697bea3 |
+// po = strchr (word[5], '\001');
|
|
|
697bea3 |
+// if (po)
|
|
|
697bea3 |
+// po[0] = 0;
|
|
|
697bea3 |
|
|
|
697bea3 |
if (is_channel (sess->server, to))
|
|
|
697bea3 |
{
|
|
|
697bea3 |
@@ -168,9 +171,10 @@
|
|
|
697bea3 |
}
|
|
|
697bea3 |
|
|
|
697bea3 |
generic:
|
|
|
697bea3 |
- po = strchr (msg, '\001');
|
|
|
697bea3 |
- if (po)
|
|
|
697bea3 |
- po[0] = 0;
|
|
|
697bea3 |
+// handled by PRIVMSG handler
|
|
|
697bea3 |
+// po = strchr (msg, '\001');
|
|
|
697bea3 |
+// if (po)
|
|
|
697bea3 |
+// po[0] = 0;
|
|
|
697bea3 |
|
|
|
697bea3 |
if (!is_channel (sess->server, to))
|
|
|
697bea3 |
{
|