From 2a3d98c996eeefcaed1559eebfadc74146e0be53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 16 May 2023 13:15:45 +0200 Subject: irc: display command 437 on server buffer when nickname cannot change while banned on channel (closes #88) --- src/plugins/irc/irc-protocol.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 6da8efce4..73424482a 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1511,7 +1511,7 @@ IRC_PROTOCOL_CALLBACK(error) IRC_PROTOCOL_CALLBACK(generic_error) { - int arg_error; + int arg_error, force_server_buffer; char *str_error, str_target[512]; const char *pos_channel, *pos_nick; struct t_irc_channel *ptr_channel; @@ -1529,8 +1529,16 @@ IRC_PROTOCOL_CALLBACK(generic_error) if (params[arg_error + 1]) { - if ((strcmp (command, "432") != 0) - && (strcmp (command, "433") != 0) + /* + * force display on server buffer for these messages: + * - 432: erroneous nickname + * - 433: nickname already in use + * - 437: nick/channel temporarily unavailable + */ + force_server_buffer = ((strcmp (command, "432") == 0) + || (strcmp (command, "433") == 0) + || (strcmp (command, "437") == 0)); + if (!force_server_buffer && irc_channel_is_channel (server, params[arg_error])) { pos_channel = params[arg_error]; -- cgit v1.2.3