diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-16 09:36:38 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 4e1d40034e31007fe619739051cd1c8e80b1f7b9 (patch) | |
tree | e8fa208d829b7ce2e21f8401b49abfdc80d158cb /src | |
parent | a1a4f337ff3d3d592640c8e0696d2e20f9d07445 (diff) | |
download | weechat-4e1d40034e31007fe619739051cd1c8e80b1f7b9.zip |
irc: use parsed command parameters in "317" command callback
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 3f27121f9..dd426010b 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4100,7 +4100,7 @@ IRC_PROTOCOL_CALLBACK(315) * Callback for the IRC command "317": whois, idle. * * Command looks like: - * :server 317 mynick nick 122877 1205327880 :seconds idle, signon time + * 317 mynick nick 122877 1205327880 :seconds idle, signon time */ IRC_PROTOCOL_CALLBACK(317) @@ -4109,17 +4109,17 @@ IRC_PROTOCOL_CALLBACK(317) time_t datetime; struct t_gui_buffer *ptr_buffer; - IRC_PROTOCOL_MIN_ARGS(6); + IRC_PROTOCOL_MIN_PARAMS(4); - idle_time = atoi (argv[4]); + idle_time = atoi (params[2]); day = idle_time / (60 * 60 * 24); hour = (idle_time % (60 * 60 * 24)) / (60 * 60); min = ((idle_time % (60 * 60 * 24)) % (60 * 60)) / 60; sec = ((idle_time % (60 * 60 * 24)) % (60 * 60)) % 60; - datetime = (time_t)(atol (argv[5])); + datetime = (time_t)(atol (params[3])); - ptr_buffer = irc_msgbuffer_get_target_buffer (server, argv[3], + ptr_buffer = irc_msgbuffer_get_target_buffer (server, params[1], command, "whois", NULL); if (day > 0) @@ -4132,8 +4132,8 @@ IRC_PROTOCOL_CALLBACK(317) "%s%s, signon at: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_msg (server, 1, NULL, argv[3]), - argv[3], + irc_nick_color_for_msg (server, 1, NULL, params[1]), + params[1], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, @@ -4165,8 +4165,8 @@ IRC_PROTOCOL_CALLBACK(317) "signon at: %s%s"), weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_msg (server, 1, NULL, argv[3]), - argv[3], + irc_nick_color_for_msg (server, 1, NULL, params[1]), + params[1], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, IRC_COLOR_CHAT_CHANNEL, |