diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-15 11:51:48 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-15 11:51:48 +0100 |
commit | c61254f256099f121b71452db964c2146ff30133 (patch) | |
tree | eb10a5e606194cc57765a8101f8dbe1d5a124a4e /src/plugins | |
parent | fdc29b5f49d0476558bd2e5de36b2cb86ab2e87f (diff) | |
download | weechat-c61254f256099f121b71452db964c2146ff30133.zip |
Add new option irc.look.buffer_auto_switch_on_join
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.c | 9 | ||||
-rw-r--r-- | src/plugins/irc/irc-config.h | 1 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index eef33b5e6..aee6330a2 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -283,7 +283,9 @@ irc_channel_new (struct t_irc_server *server, int channel_type, server->channels = new_channel; server->last_channel = new_channel; - if (switch_to_channel) + if (switch_to_channel + && ((channel_type != IRC_CHANNEL_TYPE_CHANNEL) + || weechat_config_boolean (irc_config_look_buffer_auto_switch_on_join))) { weechat_buffer_set (new_buffer, "display", (auto_switch) ? "auto" : "1"); diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index a7e7f3a67..45ad4dca0 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -50,6 +50,7 @@ struct t_config_section *irc_config_section_server = NULL; /* IRC config, look section */ +struct t_config_option *irc_config_look_buffer_auto_switch_on_join; struct t_config_option *irc_config_look_color_nicks_in_names; struct t_config_option *irc_config_look_color_nicks_in_nicklist; struct t_config_option *irc_config_look_color_nicks_in_server_messages; @@ -1792,7 +1793,13 @@ irc_config_init () weechat_config_free (irc_config_file); return 0; } - + + irc_config_look_buffer_auto_switch_on_join = weechat_config_new_option ( + irc_config_file, ptr_section, + "buffer_auto_switch_on_join", "boolean", + N_("auto switch to channel buffer on join"), + NULL, 0, 0, "on", NULL, 0, NULL, NULL, + NULL, NULL, NULL, NULL); irc_config_look_color_nicks_in_names = weechat_config_new_option ( irc_config_file, ptr_section, "color_nicks_in_names", "boolean", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index d843cf94f..cc99b0933 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -75,6 +75,7 @@ extern struct t_config_section *irc_config_section_ctcp; extern struct t_config_section *irc_config_section_server_default; extern struct t_config_section *irc_config_section_server; +extern struct t_config_option *irc_config_look_buffer_auto_switch_on_join; extern struct t_config_option *irc_config_look_color_nicks_in_names; extern struct t_config_option *irc_config_look_color_nicks_in_nicklist; extern struct t_config_option *irc_config_look_color_nicks_in_server_messages; |