From 5a89825669cc99d1c27a0fdfe75a44b211d29777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 19 Jun 2021 18:11:02 +0200 Subject: irc: add option irc.look.display_extended_join (issue #320) --- src/plugins/irc/irc-config.c | 8 ++++++++ src/plugins/irc/irc-config.h | 1 + src/plugins/irc/irc-protocol.c | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 2eb0b8635..5c2bee6d2 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -63,6 +63,7 @@ struct t_config_option *irc_config_look_display_away; struct t_config_option *irc_config_look_display_ctcp_blocked; struct t_config_option *irc_config_look_display_ctcp_reply; struct t_config_option *irc_config_look_display_ctcp_unknown; +struct t_config_option *irc_config_look_display_extended_join; struct t_config_option *irc_config_look_display_host_join; struct t_config_option *irc_config_look_display_host_join_local; struct t_config_option *irc_config_look_display_host_quit; @@ -2815,6 +2816,13 @@ irc_config_init () N_("display CTCP message even if it is unknown CTCP"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + irc_config_look_display_extended_join = weechat_config_new_option ( + irc_config_file, ptr_section, + "display_extended_join", "boolean", + N_("display extra information in the JOIN messages: account name " + "and real name (capability extended-join must be enabled)"), + NULL, 0, 0, "on", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_display_host_join = weechat_config_new_option ( irc_config_file, ptr_section, "display_host_join", "boolean", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 3f6a38e5c..d4f5c391b 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -103,6 +103,7 @@ extern struct t_config_option *irc_config_look_display_away; extern struct t_config_option *irc_config_look_display_ctcp_blocked; extern struct t_config_option *irc_config_look_display_ctcp_reply; extern struct t_config_option *irc_config_look_display_ctcp_unknown; +extern struct t_config_option *irc_config_look_display_extended_join; extern struct t_config_option *irc_config_look_display_host_join; extern struct t_config_option *irc_config_look_display_host_join_local; extern struct t_config_option *irc_config_look_display_host_quit; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index e75ed9224..2a7393fd1 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1365,7 +1365,8 @@ IRC_PROTOCOL_CALLBACK(join) ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; str_account[0] = '\0'; - if (pos_account) + if (pos_account + && weechat_config_boolean (irc_config_look_display_extended_join)) { snprintf (str_account, sizeof (str_account), "%s [%s%s%s]", @@ -1376,7 +1377,8 @@ IRC_PROTOCOL_CALLBACK(join) } str_realname[0] = '\0'; - if (pos_realname) + if (pos_realname + && weechat_config_boolean (irc_config_look_display_extended_join)) { snprintf (str_realname, sizeof (str_realname), "%s (%s%s%s)", -- cgit v1.2.3