summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-01-05 08:24:04 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-01-05 08:24:04 +0100
commit0d6b18bc543fc34f0299f625625f1cf9e464b7ec (patch)
tree25bb44e1e80e3bd56ad29b0535e3224e09fba52f /src/plugins/irc
parent8c49475f7576bd9eadb9816a9c725a2df99e85f6 (diff)
downloadweechat-0d6b18bc543fc34f0299f625625f1cf9e464b7ec.zip
irc: fix parsing of message 338 (whois, host) sent by Rizon server (closes #1737)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-protocol.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 92396f353..080668ba0 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4881,34 +4881,44 @@ IRC_PROTOCOL_CALLBACK(333)
*
* Command looks like:
* 338 mynick nick host :actually using host
+ *
+ * On Rizon server:
+ * 338 mynick nick :is actually user@host [ip]
*/
IRC_PROTOCOL_CALLBACK(338)
{
char *str_text;
- IRC_PROTOCOL_MIN_PARAMS(4);
-
- str_text = irc_protocol_string_params (params, 3, num_params - 1);
-
- weechat_printf_date_tags (
- irc_msgbuffer_get_target_buffer (
- server, params[1], command, "whois", NULL),
- date,
- irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
- "%s%s[%s%s%s]%s %s %s%s",
- weechat_prefix ("network"),
- IRC_COLOR_CHAT_DELIMITERS,
- irc_nick_color_for_msg (server, 1, NULL, params[1]),
- params[1],
- IRC_COLOR_CHAT_DELIMITERS,
- IRC_COLOR_RESET,
- str_text,
- IRC_COLOR_CHAT_HOST,
- params[2]);
+ IRC_PROTOCOL_MIN_PARAMS(3);
- if (str_text)
- free (str_text);
+ if (num_params < 4)
+ {
+ irc_protocol_cb_whois_nick_msg (server, date, irc_message, tags, nick,
+ address, host, command, ignored,
+ params, num_params);
+ }
+ else
+ {
+ str_text = irc_protocol_string_params (params, 3, num_params - 1);
+ weechat_printf_date_tags (
+ irc_msgbuffer_get_target_buffer (
+ server, params[1], command, "whois", NULL),
+ date,
+ irc_protocol_tags (command, tags, "irc_numeric", NULL, NULL),
+ "%s%s[%s%s%s]%s %s %s%s",
+ weechat_prefix ("network"),
+ IRC_COLOR_CHAT_DELIMITERS,
+ irc_nick_color_for_msg (server, 1, NULL, params[1]),
+ params[1],
+ IRC_COLOR_CHAT_DELIMITERS,
+ IRC_COLOR_RESET,
+ str_text,
+ IRC_COLOR_CHAT_HOST,
+ params[2]);
+ if (str_text)
+ free (str_text);
+ }
return WEECHAT_RC_OK;
}