From bb92a2dbc765f365fe10054acc8f0f01e06a7f38 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 3 Apr 2009 17:49:58 +0000 Subject: [PATCH] Show numerics directed at channels in the channel window. This is about numerics where the target parameter is a channel, i.e. ": <#channel> ..." Usually, this parameter is the user's nick or an asterisk. An example is the numeric ircd-ratbox and charybdis send to channel operators on a successful /knock. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5056 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-events-numeric.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index dbc061d7..93e1d79a 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -555,13 +555,15 @@ static void print_event_received(IRC_SERVER_REC *server, const char *data, g_return_if_fail(data != NULL); - /* skip first param, it's always our nick */ + /* first param is our nick, "*" or a channel */ ptr = strchr(data, ' '); if (ptr == NULL) return; ptr++; - if (!target_param || *ptr == ':' || (ptr2 = strchr(ptr, ' ')) == NULL) + if (ischannel(*data)) /* directed at channel */ + target = g_strndup(data, (int)(ptr - data - 1)); + else if (!target_param || *ptr == ':' || (ptr2 = strchr(ptr, ' ')) == NULL) target = NULL; else { /* target parameter expected and present */