summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/irc/irc-protocol.c11
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp8
2 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 653ae50e4..01d507408 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4452,7 +4452,7 @@ IRC_PROTOCOL_CALLBACK(328)
* Callback for the IRC command "329": channel creation date.
*
* Command looks like:
- * :server 329 mynick #channel 1205327894
+ * 329 mynick #channel 1205327894
*/
IRC_PROTOCOL_CALLBACK(329)
@@ -4460,12 +4460,11 @@ IRC_PROTOCOL_CALLBACK(329)
struct t_irc_channel *ptr_channel;
time_t datetime;
- IRC_PROTOCOL_MIN_ARGS(5);
+ IRC_PROTOCOL_MIN_PARAMS(3);
- ptr_channel = irc_channel_search (server, argv[3]);
+ ptr_channel = irc_channel_search (server, params[1]);
- datetime = (time_t)(atol ((argv_eol[4][0] == ':') ?
- argv_eol[4] + 1 : argv_eol[4]));
+ datetime = (time_t)(atol (params[2]));
if (ptr_channel)
{
@@ -4494,7 +4493,7 @@ IRC_PROTOCOL_CALLBACK(329)
_("%sChannel %s%s%s created on %s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
- argv[3],
+ params[1],
IRC_COLOR_RESET,
weechat_util_get_time_string (&datetime));
}
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 45756d782..2f787c69b 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -2721,13 +2721,13 @@ TEST(IrcProtocolWithServer, 329)
{
SRV_INIT_JOIN;
- /* not enough arguments */
+ /* not enough parameters */
RECV(":server 329");
- CHECK_ERROR_ARGS("329", 2, 5);
+ CHECK_ERROR_PARAMS("329", 0, 3);
RECV(":server 329 alice");
- CHECK_ERROR_ARGS("329", 3, 5);
+ CHECK_ERROR_PARAMS("329", 1, 3);
RECV(":server 329 alice #test");
- CHECK_ERROR_ARGS("329", 4, 5);
+ CHECK_ERROR_PARAMS("329", 2, 3);
RECV(":server 329 alice #test 1205327894");
CHECK_CHAN("-- Channel created on Wed, 12 Mar 2008 13:18:14");