summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-06-19 18:11:02 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-06-19 18:12:22 +0200
commit5a89825669cc99d1c27a0fdfe75a44b211d29777 (patch)
tree2d29a93c13eea59558054d2451009ec6c5265190 /src/plugins
parenteb2a42c99e6fbec5fa34c46774dfc4b9ef381691 (diff)
downloadweechat-5a89825669cc99d1c27a0fdfe75a44b211d29777.zip
irc: add option irc.look.display_extended_join (issue #320)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-config.c8
-rw-r--r--src/plugins/irc/irc-config.h1
-rw-r--r--src/plugins/irc/irc-protocol.c6
3 files changed, 13 insertions, 2 deletions
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)",