diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-03-18 20:39:42 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-03-18 20:39:42 +0100 |
commit | f6c50615909c438b483a70967f77bc0771789f52 (patch) | |
tree | 996a1f1c9e101ac0af00f1b1bd6202f47a0adf12 | |
parent | 1ef7a55e727f6936ee8aee702d8e2daa4c767d52 (diff) | |
download | weechat-f6c50615909c438b483a70967f77bc0771789f52.zip |
irc: fix update of channels modes with arguments when joining a channel (closes #1324)
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-mode.c | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 10 |
3 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 4949a37ad..23366feb2 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -33,6 +33,7 @@ Bug fixes:: * core: set max length to 4096 for /secure passphrase (issue #1323) * core: refilter only affected buffers on filter change (issue #1309, issue #1311) * fset: fix slow refresh of fset buffer during /reload (issue #1313) + * irc: fix update of channels modes with arguments when joining a channel (issue #1324) * irc: quote NICK command argument sent to the server (issue #1319) * php: fix memory leak in functions string_eval_expression, string_eval_path_home, key_bind, hook_process_hashtable, hook_hsignal_send, info_get_hashtable, hdata_update * spell: fix detection of nick followed by the nick completer (issue #1306, issue #1307) 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 |