summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-protocol.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-15 19:25:43 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commitec816b4be5c3c5cd0ac3acb64e0f3e453eb1469b (patch)
tree64a7bc482a67ea5debe8119a890b6eacb716443c /src/plugins/irc/irc-protocol.c
parent7c1ea1cb326d78793f5198496386ee977ec5070c (diff)
downloadweechat-ec816b4be5c3c5cd0ac3acb64e0f3e453eb1469b.zip
irc: use parsed command parameters in "wallops" command callback
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r--src/plugins/irc/irc-protocol.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 2bbcd9331..6510dd232 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -3320,19 +3320,23 @@ IRC_PROTOCOL_CALLBACK(topic)
* Callback for the IRC command "WALLOPS".
*
* Command looks like:
- * :nick!user@host WALLOPS :message from admin
+ * WALLOPS :message from admin
*/
IRC_PROTOCOL_CALLBACK(wallops)
{
const char *nick_address;
+ char *str_params;
- IRC_PROTOCOL_MIN_ARGS(3);
+ IRC_PROTOCOL_MIN_PARAMS(1);
if (ignored)
return WEECHAT_RC_OK;
nick_address = irc_protocol_nick_address (server, 0, NULL, nick, address);
+
+ str_params = irc_protocol_string_params (params, 0, num_params - 1);
+
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, nick, command, NULL, NULL),
date,
@@ -3340,7 +3344,10 @@ IRC_PROTOCOL_CALLBACK(wallops)
_("%sWallops from %s: %s"),
weechat_prefix ("network"),
(nick_address[0]) ? nick_address : "?",
- (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]);
+ str_params);
+
+ if (str_params)
+ free (str_params);
return WEECHAT_RC_OK;
}