diff options
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 10 | ||||
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 4183497e3..6a7c714c2 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4573,7 +4573,7 @@ IRC_PROTOCOL_CALLBACK(330_343) * Callback for the IRC command "331": no topic for channel. * * Command looks like: - * :server 331 mynick #channel :There isn't a topic. + * 331 mynick #channel :There isn't a topic. */ IRC_PROTOCOL_CALLBACK(331) @@ -4581,19 +4581,19 @@ IRC_PROTOCOL_CALLBACK(331) struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; - IRC_PROTOCOL_MIN_ARGS(4); + IRC_PROTOCOL_MIN_PARAMS(2); - ptr_channel = irc_channel_search (server, argv[3]); + ptr_channel = irc_channel_search (server, params[1]); ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer; weechat_printf_date_tags ( irc_msgbuffer_get_target_buffer ( - server, argv[3], command, NULL, ptr_buffer), + server, params[1], command, NULL, ptr_buffer), date, irc_protocol_tags (command, "irc_numeric", NULL, NULL), _("%sNo topic set for channel %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_CHANNEL, - argv[3]); + params[1]); return WEECHAT_RC_OK; } diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 12a4f9dde..00241edc2 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -2787,11 +2787,11 @@ TEST(IrcProtocolWithServer, 331) { SRV_INIT_JOIN; - /* not enough arguments */ + /* not enough parameters */ RECV(":server 331"); - CHECK_ERROR_ARGS("331", 2, 4); + CHECK_ERROR_PARAMS("331", 0, 2); RECV(":server 331 alice"); - CHECK_ERROR_ARGS("331", 3, 4); + CHECK_ERROR_PARAMS("331", 1, 2); RECV(":server 331 alice #test"); CHECK_CHAN("-- No topic set for channel #test"); |