diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-14 22:42:07 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 8ea41d91c98959e519c4ddfa220ea521c9d041a9 (patch) | |
tree | 233c4226bbc97e02090bacdb12658f50b575f716 /src/plugins/irc/irc-protocol.c | |
parent | 7a88e007a55b11abba7e2232fa577d772772de84 (diff) | |
download | weechat-8ea41d91c98959e519c4ddfa220ea521c9d041a9.zip |
irc: use parsed command parameters in "ping" command callback
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index d391ade53..b927f388e 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -2528,10 +2528,16 @@ IRC_PROTOCOL_CALLBACK(part) IRC_PROTOCOL_CALLBACK(ping) { - IRC_PROTOCOL_MIN_ARGS(2); + char *str_params; - irc_server_sendf (server, 0, NULL, "PONG :%s", - (argv_eol[1][0] == ':') ? argv_eol[1] + 1 : argv_eol[1]); + IRC_PROTOCOL_MIN_PARAMS(1); + + str_params = irc_protocol_string_params (params, 0, num_params - 1); + + irc_server_sendf (server, 0, NULL, "PONG :%s", str_params); + + if (str_params) + free (str_params); return WEECHAT_RC_OK; } |