mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Changed CTCP handler to remove the later \001 only if it was at the end of
the line, so you couldn't hide text by typing eg. \001foo\001hidden text. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2870 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
0a1e18b50d
commit
d5ded8f977
@ -269,7 +269,8 @@ static void ctcp_reply(IRC_SERVER_REC *server, const char *data,
|
||||
static void event_privmsg(IRC_SERVER_REC *server, const char *data,
|
||||
const char *nick, const char *addr)
|
||||
{
|
||||
char *params, *target, *msg, *ptr;
|
||||
char *params, *target, *msg;
|
||||
int len;
|
||||
|
||||
g_return_if_fail(data != NULL);
|
||||
|
||||
@ -277,9 +278,11 @@ static void event_privmsg(IRC_SERVER_REC *server, const char *data,
|
||||
|
||||
/* handle only ctcp messages.. */
|
||||
if (*msg == 1) {
|
||||
/* remove the later \001 */
|
||||
ptr = strrchr(++msg, 1);
|
||||
if (ptr != NULL) *ptr = '\0';
|
||||
/* remove the \001 at beginning and end */
|
||||
msg++;
|
||||
len = strlen(msg);
|
||||
if (msg[len-1] == '\001')
|
||||
msg[len-1] = '\0';
|
||||
|
||||
signal_emit("ctcp msg", 5, server, msg, nick, addr, target);
|
||||
signal_stop();
|
||||
|
Loading…
Reference in New Issue
Block a user