From fe872f26d4b62c09dd017094492f3b2712e1a0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 28 May 2014 20:11:12 +0200 Subject: [PATCH] irc: fix extract of channel in parser for JOIN/PART messages when there is a colon before the channel name (closes #83) The problem was only affecting scripts or triggers using the parser. The irc plugin does not use the "channel" variable built by the parser (when parsing JOIN/PART messages). --- ChangeLog.asciidoc | 2 ++ src/plugins/irc/irc-message.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 41b54199a..00eb7c459 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -106,6 +106,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * alias: change default command for alias /beep to "/print -beep" * exec: add exec plugin: new command /exec and file exec.conf * guile: fix module used after unload of a script +* irc: fix extract of channel in parser for JOIN/PART messages when there is a + colon before the channel name (closes #83) * irc: fix duplicate sender name in display of notice (closes #87) * irc: fix refresh of buffer name in bar items after join/part/kick/kill (closes #86) diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 8c3b842f2..7721c57b3 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -151,6 +151,12 @@ irc_message_parse (struct t_irc_server *server, const char *message, /* now we have: pos --> "#channel :hello!" */ if (arguments) *arguments = strdup (pos); + if ((pos[0] == ':') + && ((strncmp (ptr_message, "JOIN ", 5) == 0) + || (strncmp (ptr_message, "PART ", 5) == 0))) + { + pos++; + } if (pos[0] != ':') { if (irc_channel_is_channel (server, pos))