Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312568 Details for
Bug 136545
xchat's IRC driver does not handle multiline messages gracefully
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Updated version of zed's version of daniel reed's patch
xchat-cvs-20080724-ctcpdequote.patch (text/plain), 6.77 KB, created by
Uli M
on 2008-07-24 15:12:15 UTC
(
hide
)
Description:
Updated version of zed's version of daniel reed's patch
Filename:
MIME Type:
Creator:
Uli M
Created:
2008-07-24 15:12:15 UTC
Size:
6.77 KB
patch
obsolete
>Index: common/cfgfiles.c >=================================================================== >RCS file: /cvsroot/xchat/xchat2/src/common/cfgfiles.c,v >retrieving revision 1.112 >diff -u -r1.112 cfgfiles.c >--- common/cfgfiles.c 15 Jun 2008 04:40:29 -0000 1.112 >+++ common/cfgfiles.c 24 Jul 2008 15:00:27 -0000 >@@ -552,6 +552,7 @@ > {"text_max_indent", P_OFFINT (max_auto_indent), TYPE_INT}, > {"text_max_lines", P_OFFINT (max_lines), TYPE_INT}, > {"text_replay", P_OFFINT (text_replay), TYPE_BOOL}, >+ {"text_max_newlines", P_OFFINT (text_max_newlines), TYPE_INT}, > {"text_show_marker", P_OFFINT (show_marker), TYPE_BOOL}, > {"text_show_sep", P_OFFINT (show_separator), TYPE_BOOL}, > {"text_stripcolor", P_OFFINT (stripcolor), TYPE_BOOL}, >@@ -640,6 +641,7 @@ > /*prefs.style_inputbox = 1;*/ > prefs.dccpermissions = 0600; > prefs.max_lines = 500; >+ prefs.text_max_newlines = 6; > prefs.mainwindow_width = 640; > prefs.mainwindow_height = 400; > prefs.dialog_width = 500; >Index: common/ctcp.c >=================================================================== >RCS file: /cvsroot/xchat/xchat2/src/common/ctcp.c,v >retrieving revision 1.19 >diff -u -r1.19 ctcp.c >--- common/ctcp.c 3 Oct 2006 04:11:54 -0000 1.19 >+++ common/ctcp.c 24 Jul 2008 15:00:30 -0000 >@@ -55,18 +55,9 @@ > char *ctcp) > { > int ret = 0; >- char *po; > struct popup *pop; > GSList *list = ctcp_list; > >- po = strchr (ctcp, '\001'); >- if (po) >- *po = 0; >- >- po = strchr (word_eol[5], '\001'); >- if (po) >- *po = 0; >- > while (list) > { > pop = (struct popup *) list->data; >@@ -84,7 +75,6 @@ > ctcp_handle (session *sess, char *to, char *nick, > char *msg, char *word[], char *word_eol[], int id) > { >- char *po; > session *chansess; > server *serv = sess->server; > char outbuf[1024]; >@@ -139,10 +129,6 @@ > { > if (!strncasecmp (msg, "SOUND", 5)) > { >- po = strchr (word[5], '\001'); >- if (po) >- po[0] = 0; >- > if (is_channel (sess->server, to)) > { > chansess = find_channel (sess->server, to); >@@ -169,10 +155,6 @@ > } > > generic: >- po = strchr (msg, '\001'); >- if (po) >- po[0] = 0; >- > if (!is_channel (sess->server, to)) > { > EMIT_SIGNAL (XP_TE_CTCPGEN, sess->server->front_session, msg, nick, >Index: common/proto-irc.c >=================================================================== >RCS file: /cvsroot/xchat/xchat2/src/common/proto-irc.c,v >retrieving revision 1.69 >diff -u -r1.69 proto-irc.c >--- common/proto-irc.c 25 May 2008 05:36:25 -0000 1.69 >+++ common/proto-irc.c 24 Jul 2008 15:00:31 -0000 >@@ -883,6 +883,128 @@ > } > } > >+static void >+dequote_ctcp (char *text) >+{ >+#define M_QUOTE '\020' >+#define X_DELIM '\001' >+#define X_QUOTE '\134' >+ /* find and dequote low-level CTCP quoting */ >+ char *ptr = text; >+ int new_lines = 0; >+ >+ if (prefs.text_max_newlines < 1) >+ return; >+ >+ while ((ptr = strchr(ptr, M_QUOTE)) != NULL) >+ { >+ switch(*(ptr+1)) >+ { >+ case 'r': >+ *(ptr+1) = '\r'; >+ break; >+ case 'n': >+ if (*(ptr+2) != 0) /* don't allow trailing \n */ >+ { >+ *(ptr+1) = '\n'; >+ new_lines++; >+ } else >+ { >+ *(ptr+1) = 0; >+ } >+ break; >+ case '0': >+ *(ptr+1) = 0; >+ break; >+ } >+ memmove(ptr, ptr+1, strlen(ptr+1)+1); >+ ptr++; >+ >+ /* reached the limit? ignore the rest */ >+ if (new_lines >= prefs.text_max_newlines) >+ break; >+ } >+} >+ >+static void >+process_privmsg (session *sess, char *nick, char *ip, char *word[], char *word_eol[]) >+{ >+ server *serv = sess->server; >+ char *to = word[3]; >+ char *text; >+ int id = FALSE; /* identified */ >+ >+ if (!(*to)) >+ return; >+ >+ text = word_eol[4]; >+ if (*text == ':') >+ text++; >+ if (serv->have_idmsg) >+ { >+ if (*text == '+') >+ { >+ id = TRUE; >+ text++; >+ } else if (*text == '-') >+ text++; >+ } >+ >+ dequote_ctcp (text); >+ >+ { /* find, handle, and remove CTCP messages */ >+ char *start, *end; >+ >+ while (((start = strchr(text, X_DELIM)) != NULL) && ((end = strchr(start+1, X_DELIM)) != NULL)) >+ { >+ *end = 0; >+ >+ if (strncasecmp(start+1, "ACTION ", sizeof("ACTION ")-1) != 0) >+ flood_check(nick, ip, serv, sess, 0); >+ if (strncasecmp(text, "DCC ", sizeof("DCC ")-1) == 0) >+ /* redo this with handle_quotes TRUE */ >+ process_data_init (word[1], word_eol[1], word, word_eol, TRUE, FALSE); >+ else >+ /* redo this to update the word[] array (word_eol[] was changed via 'text' ptr) */ >+ process_data_init (word[1], word_eol[1], word, word_eol, FALSE, FALSE); >+ >+ { /* inline CTCP dequote */ >+ char *ptr = start+1; >+ >+ while ((ptr = strchr(ptr, X_QUOTE)) != NULL) >+ { >+ switch(*(ptr+1)) >+ { >+ case 'a': >+ *(ptr+1) = X_DELIM; >+ break; >+ } >+ memmove(ptr, ptr+1, strlen(ptr+1)+1); >+ ptr++; >+ } >+ } >+ >+ ctcp_handle(sess, to, nick, start+1, word, word_eol, id); >+ memmove(start, end+1, strlen(end+1)+1); >+ } >+ } >+ >+ if (*text != 0) >+ { >+ if (is_channel (serv, to)) >+ { >+ if (ignore_check (word[1], IG_CHAN)) >+ return; >+ inbound_chanmsg (serv, NULL, to, nick, text, FALSE, id); >+ } else >+ { >+ if (ignore_check (word[1], IG_PRIV)) >+ return; >+ inbound_privmsg (serv, nick, ip, text, id); >+ } >+ } >+} >+ > /* handle named messages that starts with a ':' */ > > static void >@@ -1032,51 +1154,7 @@ > return; > > case WORDL('P','R','I','V'): >- { >- char *to = word[3]; >- int len; >- int id = FALSE; /* identified */ >- if (*to) >- { >- text = word_eol[4]; >- if (*text == ':') >- text++; >- if (serv->have_idmsg) >- { >- if (*text == '+') >- { >- id = TRUE; >- text++; >- } else if (*text == '-') >- text++; >- } >- len = strlen (text); >- if (text[0] == 1 && text[len - 1] == 1) /* ctcp */ >- { >- text[len - 1] = 0; >- text++; >- if (strncasecmp (text, "ACTION", 6) != 0) >- flood_check (nick, ip, serv, sess, 0); >- if (strncasecmp (text, "DCC ", 4) == 0) >- /* redo this with handle_quotes TRUE */ >- process_data_init (word[1], word_eol[1], word, word_eol, TRUE, FALSE); >- ctcp_handle (sess, to, nick, text, word, word_eol, id); >- } else >- { >- if (is_channel (serv, to)) >- { >- if (ignore_check (word[1], IG_CHAN)) >- return; >- inbound_chanmsg (serv, NULL, to, nick, text, FALSE, id); >- } else >- { >- if (ignore_check (word[1], IG_PRIV)) >- return; >- inbound_privmsg (serv, nick, ip, text, id); >- } >- } >- } >- } >+ process_privmsg (sess, nick, ip, word, word_eol); > return; > > case WORDL('T','O','P','I'): >Index: common/xchat.h >=================================================================== >RCS file: /cvsroot/xchat/xchat2/src/common/xchat.h,v >retrieving revision 1.89 >diff -u -r1.89 xchat.h >--- common/xchat.h 24 Feb 2008 02:56:02 -0000 1.89 >+++ common/xchat.h 24 Jul 2008 15:00:31 -0000 >@@ -165,6 +165,7 @@ > int max_auto_indent; > int dcc_blocksize; > int max_lines; >+ int text_max_newlines; > int notify_timeout; > int dcctimeout; > int dccstalltimeout;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 136545
:
105635
| 312568