summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-03-18 20:39:42 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-03-18 20:39:42 +0100
commitf6c50615909c438b483a70967f77bc0771789f52 (patch)
tree996a1f1c9e101ac0af00f1b1bd6202f47a0adf12 /src
parent1ef7a55e727f6936ee8aee702d8e2daa4c767d52 (diff)
downloadweechat-f6c50615909c438b483a70967f77bc0771789f52.zip
irc: fix update of channels modes with arguments when joining a channel (closes #1324)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-mode.c2
-rw-r--r--src/plugins/irc/irc-protocol.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c
index 34a870aba..d05ae2318 100644
--- a/src/plugins/irc/irc-mode.c
+++ b/src/plugins/irc/irc-mode.c
@@ -342,11 +342,13 @@ irc_mode_channel_set (struct t_irc_server *server,
argc = 0;
argv = NULL;
if (modes_arguments)
+ {
argv = weechat_string_split (modes_arguments, " ",
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0, &argc);
+ }
current_arg = 0;
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 71c9aacab..f82edc339 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -3566,13 +3566,15 @@ IRC_PROTOCOL_CALLBACK(323)
IRC_PROTOCOL_CALLBACK(324)
{
- const char *ptr_modes;
+ const char *ptr_modes, *ptr_modes_args;
struct t_irc_channel *ptr_channel;
+ IRC_PROTOCOL_MIN_ARGS(4);
+
ptr_modes = (argc > 4) ?
((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL;
-
- IRC_PROTOCOL_MIN_ARGS(4);
+ ptr_modes_args = (argc > 5) ?
+ ((argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5]) : NULL;
ptr_channel = irc_channel_search (server, argv[3]);
if (ptr_channel)
@@ -3581,7 +3583,7 @@ IRC_PROTOCOL_CALLBACK(324)
if (argc > 4)
{
(void) irc_mode_channel_set (server, ptr_channel, host,
- ptr_modes, NULL);
+ ptr_modes, ptr_modes_args);
}
}
if (!ptr_channel