summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-17 20:24:18 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commitcde0d5f7a5ad4ad4883e5046e481c73f88e79381 (patch)
tree25c8a164d7ef18b02ba48e0d7e40534c155e6f50 /src
parentba5b744397eb73cd0818f97c2fd084f271b6eb46 (diff)
downloadweechat-cde0d5f7a5ad4ad4883e5046e481c73f88e79381.zip
irc: do not display "*" when received as nick in command 900
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-protocol.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 9266b96b1..43b06bd39 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -6823,27 +6823,44 @@ IRC_PROTOCOL_CALLBACK(734)
*
* Command looks like:
* 900 mynick nick!user@host mynick :You are now logged in as mynick
+ * 900 * * mynick :You are now logged in as mynick
*/
IRC_PROTOCOL_CALLBACK(900)
{
char *str_params;
+ const char *pos_nick_host;
IRC_PROTOCOL_MIN_PARAMS(4);
+ pos_nick_host = (strcmp (params[1], "*") != 0) ? params[1] : NULL;
+
str_params = irc_protocol_string_params (params, 3, num_params - 1);
- weechat_printf_date_tags (
- irc_msgbuffer_get_target_buffer (server, params[1], command, NULL, NULL),
- date,
- irc_protocol_tags (command, "irc_numeric", NULL, NULL),
- "%s%s %s(%s%s%s)",
- weechat_prefix ("network"),
- str_params,
- IRC_COLOR_CHAT_DELIMITERS,
- IRC_COLOR_CHAT_HOST,
- params[1],
- IRC_COLOR_CHAT_DELIMITERS);
+ if (pos_nick_host)
+ {
+ weechat_printf_date_tags (
+ irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
+ date,
+ irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ "%s%s %s(%s%s%s)",
+ weechat_prefix ("network"),
+ str_params,
+ IRC_COLOR_CHAT_DELIMITERS,
+ IRC_COLOR_CHAT_HOST,
+ pos_nick_host,
+ IRC_COLOR_CHAT_DELIMITERS);
+ }
+ else
+ {
+ weechat_printf_date_tags (
+ irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
+ date,
+ irc_protocol_tags (command, "irc_numeric", NULL, NULL),
+ "%s%s",
+ weechat_prefix ("network"),
+ str_params);
+ }
irc_server_free_sasl_data (server);